-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
plan and template data source with aws_elasticsearch_domain for policy keeps complaining it has changed when it has not #9107
Comments
Hi @plombardi89. Sorry for the issue here. Would it be possible for you to share the diff output (scrubbed of any sensitive info) from A frequent issue with IAM policies in Terraform is that the AWS services like to "normalize" them when returning them from the API, which causes diffs in spite of the meaning being the same. You mentioned in your report specifically that the template is what is showing as changed, but I'm curious as to whether it's actually the |
@apparentlymart Working on something else at the moment but I'll try and get what you asked for in a little bit. |
|
Thanks @plombardi89! Here's what Terraform read back from the API as the current state: {
"Statement": [{
"Effect": "Allow",
"Action": "es:*",
"Principal": "*",
"Resource": "arn:aws:es:us-east-1:914373874199:domain/tracing-develop/*"
"Condition": {
"IpAddress": {
"aws:SourceIp": "52.202.51.119"
}
},
}],
"Version": "2012-10-17"
} ...and here's what your template generated in the config:
Notice that the API response includes the extra Unfortunately this one is proving hard to resolve because it requires us to "predict" an appropriate ARN value for In the mean time, the workaround would be for you to explicitly specify the Resource ARN in your policy, which will then allow Terraform to see it as unchanged and not re-apply the change. Since we already have several other issues open for this, I'm going to close this one to consolidate the discussion. Please feel free to re-open it if you think there's something unique about this case that isn't covered by the others. Thanks again for the bug report! |
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. |
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform Version
[plombardi@plombardi-lt0 managed-infrastructure]$ bin/terraform version
Terraform v0.7.4
Affected Resource(s)
If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.
Terraform Configuration Files
IAM Policy Template
Expected Behavior
Plan should not keep claiming the template has changed (it has not).
Actual Behavior
Plan keeps complaining that the template has changed and forcing an update of the policy on AWS.
Steps to Reproduce
terraform plan
The text was updated successfully, but these errors were encountered: