-
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
Template file used as user data is forcing new resources when no changes have been made #4358
Comments
I think this is just a consequence of how the However, it's interacting poorly here because now your user_data is being updated to a value that is "computed" until the I think this workaround will work:
This sort of weird interaction should be addressed by the architectural change we're discussing in #4169, since it will help Terraform understand that a template file is not something for which "create" and "destroy" are meaningful operations, and it will just always render the template at "plan" time, allowing the diff to reflect the final value and, in your case, see that it hasn't actually changed. |
The workaround worked flawlessly; thanks for the update! |
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. |
I was upgrading my terraform version to the latest (0.6.8), when I noticed a deprecation warning during
terraform plan
about the new template syntax:So then I updated the template declaration from:
to:
And this template is to be rendered as user data for a aws_launch_configuration:
Now, on the old terraform version (and indeed on the old syntax), the
plan
would correctly detect that nothing has changed, as my infrastructure is up-to-date. But with the new syntax, I get:Which sounds like it will destroy the existing infrastructure and recreate it, when I was expecting zero changes. Is there any reason why the new syntax would cause
${template_file.userdata-consul.rendered}
to show up as a different hash?The text was updated successfully, but these errors were encountered: