-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
aws_iam_role_policy_attachment resource produced new value for was present but now absent #11839
Comments
I experience this issue with terraform v0.12.21 and aws provider version 2.52.0. |
It appears that I had the issue because I used uppercase in the policy_arn, but in fact the policy name was all lowercase. |
I got the same error when using an AWS managed policy, but with an ARN that contained the wrong partition. I applied the Using the correct partition fixed the issue and did not result in this error. The fix may simply be a more specific error message. AWS provider v2.58.0 (Copied here from #8751; this is a more relevant issue) |
It took me a while to find a single character difference in a policy name, but it was it. It seems like API IAM API treats managed policy names as case insensitive, while Terraform looks for a case-sensitive match. API docs don't mention case sensitivity at all. Either way it should be consistent at least with reality (a case insensitive match). |
@bondsbw Thank you! I think a good resolution here would be to print a better error out when the ARN partition is incorrect. This seems like it would be a common issue. Also, a useful trick:
Then for an ARN: |
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! |
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. |
Terraform version:
Terraform v0.12.19
Affected Resource(s):
aws_iam_role_policy_attachment
Terraform Configuration:
Error received:
I am consistently getting the following error when attempting to attach a policy to a role. @camlow325 reported a similar issue in 10549, and mentioned this may be an eventual consistency issue. Is similar retry logic needed here?
Error: Provider produced inconsistent result after apply
When applying changes to
module.eks_control_plane.aws_iam_role_policy_attachment.ClusterAutoScaler_polattach,
provider "registry.terraform.io/-/aws" produced an unexpected new value for
was present, but now absent.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Expected Behavior:
I was expecting the policy to be attached without issue.
Steps to reproduce:
Running terraform apply produces this issue consistently.
Additional information:
Glad to provide additional information to help debug this issue
The text was updated successfully, but these errors were encountered: