It would be useful if resources aws_iam_group_policy_attachment and aws_iam_user_policy_attachment had imports implemented, similar to what aws_iam_role_policy_attachment currently has. A similar parsing mechanic could be used and I would imagine the logic is about the same. Having this implemented would help facilitate bringing Terraform into live environments where these attachment styles are preferred.
resource "aws_iam_group_policy_attachment" "test-attach" {
group = "${aws_iam_group.group.name}"
policy_arn = "${aws_iam_policy.policy.arn}"
}
That looks great! That looks like it touches aws_iam_user_policy_attachment, it also possible to address aws_iam_group_policy_attachment? I believe it should be nearly the same change. I can also take a shot at it, but I don't believe I have the environment set up to test to make sure the change works and the tests pass.
Thank you!
Support for importing aws_iam_group_policy_attachment and aws_iam_user_policy_attachment resources has been merged and will release with version 1.51.0 of the AWS provider, likely middle of this week. 👍
This has been released in version 1.51.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
Support for importing
aws_iam_group_policy_attachmentandaws_iam_user_policy_attachmentresources has been merged and will release with version 1.51.0 of the AWS provider, likely middle of this week. 👍