There's iam_policy_attachment but it's exclusive and there's a risk to accidentally revoke an attachment that is managed outside of this resource. For more details, please refer to the warning on the official documentation. https://www.terraform.io/docs/providers/aws/r/iam_policy_attachment.html
What
Use iam_role_policy_attachment, iam_group_policy_attachment or iam_user_policy_attachment as the documentation suggests.
Only iam_role_policy_attachment is added in this PR
Check
Added resource: iam_role_policy_attachment
[x] Class name: IAMRolePolicyAttachment
[x] File name: iam_role_policy_attachment.rb
[x] Command name: iamrpa
[x] Executed terraform plan for my own resources and confirmed there's no changes
terraform plan
...
------------------------------------------------------------------------
No changes. Infrastructure is up-to-date.
This means that Terraform did not detect any differences between your
configuration and real physical resources that exist. As a result, no
actions need to be performed.
Future work
Add iam_user_policy_attachment and iam_group_policy_attachment
Coverage remained the same at 100.0% when pulling 3269925f5937ed123009677d190cee638b16d04a on nakamasato:iam_role_policy_attachment into 518879dfe36542b8bb1fbd37281ba4a862a920e4 on dtan4:master.
Coverage remained the same at 100.0% when pulling 4dc2401a827fc4c4ea099c3bb4a07581c53ebee7 on nakamasato:iam_role_policy_attachment into 518879dfe36542b8bb1fbd37281ba4a862a920e4 on dtan4:master.
Why
iam_policy_attachment
but it's exclusive and there's a risk to accidentally revoke an attachment that is managed outside of this resource. For more details, please refer to the warning on the official documentation. https://www.terraform.io/docs/providers/aws/r/iam_policy_attachment.htmlWhat
iam_role_policy_attachment
,iam_group_policy_attachment
oriam_user_policy_attachment
as the documentation suggests.iam_role_policy_attachment
is added in this PRCheck
iam_role_policy_attachment
IAMRolePolicyAttachment
iam_role_policy_attachment.rb
iamrpa
[x] Executed
terraform plan
for my own resources and confirmed there's no changesFuture work
Add
iam_user_policy_attachment
andiam_group_policy_attachment