-
Notifications
You must be signed in to change notification settings - Fork 142
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
HEREDOC formatting of condition.statement always detects a change #123
Comments
It seems to do this with a log format HEREDOC as well. |
This seems to be some discrepancy around how Terraform stores things into the state with trailing newlines (it seems to strip them). If you put your HEREDOC into a local var, and then have a different local var which is |
For anybody coming to this today, I followed @ziggythehamster's suggestion above, but used trimspace instead to remove whitespace from both ends of the string (instead of just the end) and now my terraform plans are clean |
In the case of |
For me, when working with the snippet's
I hope this helps someone struggling like me! |
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
https://gist.github.com/querry43/98e192d17f3c0404a6a66f12ac45eafe
Panic Output
Expected Behavior
When a condition statement is represented with a heredoc, but the contents of the heredoc do not change, terraform should determine that there is no change to apply.
Actual Behavior
Terraform always applies a diff.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
It looks like the set hash is changing and causing the resource to be recreated. At first I thought it was related to \n literals in the json, but if that was the case, then the following diff should have resolved it. It did not.
References
The text was updated successfully, but these errors were encountered: