-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting Policy Attachment for single role remove attachment for all other roles #3555
Comments
Turns out this was a problem with the resource The problem was fixed using |
@gbrahmi thanks for the followup and sorry you got tripped up by that. Is there any way we can improve the documentation? I'm going to close this issue just to keep the repository clean (since I know you can't due to the bot moving it), but don't hesitate to reply back with any recommendations and we can reopen if necessary. |
I have 4 suggestions suggestion #1 https://www.terraform.io/docs/providers/aws/r/iam_policy_attachment.html suggestion #2 I also suggest you change the title description of these 3 help pages to indicate they are just for specified user(s), role(s), group(s) indicated and does not apply to all suggestion #3 suggestion #4 resource "aws_iam_group" "administrators" { resource "aws_iam_user" "admin1" { |
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! |
This issue was originally opened by @gbrahmi as hashicorp/terraform#17455. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
Terraform Configuration Files
role_1 deployment:
role_2 deployment:
Expected Behavior
Terrraform should only be able to manage the resources which are created by it. It should not change, delete, or remove any policy attachment for resources which are created outside terraform or managed by another terraform instance.
Actual Behavior
Terraform is actually removing the policy attachment for a role which is created outside terraform. In my case to reproduce the problem I've created two separate terraform deployments and deployed them separately.
The two deployments are role_1 and role_2 which have a managed policy attachment.
After I deploy role_1 and role_2, when I go back and destroy role_2 it goes out and removes the policy attachment for role_1 as well.
Steps to Reproduce
For role_1 in a separate terraform deployment:
For role_2 in a separate terraform deployment:
Now destroy the role_2 deployment.
Be care while doing this, since it will go out and remove the attached policy from every role in the account. We used Kinesis in our case since we are not using it anywhere in our deployment/account.
Check the policy attachment for role_1. It will no longer have the Managed Policy attached to role_1 anymore.
Additional Context
References
The text was updated successfully, but these errors were encountered: