Open brunobritodev opened 2 years ago
Hey @brunohbrito 👋 I looked into this a bit and came across this helpful comment that gave a breakdown on why this happens and how to get around it. Can you take a look over that and let me know if it helps you get past this issue?
@justinretzolk In this case no. Even if we set force_destroy = true
on aws_iam_users
the same error happens.
The destroy order here is important. So a workaround is first run a terraform apply -target=aws_iam_policy_attachment.powerusers
, then terraform apply
, so the users are removed.
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Actual Behavior
It must remove policy attachment first, then remove user. Actually it tries to remove user first.
Steps to Reproduce
terraform apply
user_b
from listterraform apply