You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
terraform init
terraform apply
For role_2 in a separate terraform deployment:
terraform init
terraform apply
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.
terraform destroy
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:
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Apr 4, 2020
This issue was closed.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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: