-
Notifications
You must be signed in to change notification settings - Fork 66
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
Terraform reports an "inconsistent final plan" if a templatefile changes between plan and apply #79
Comments
Hello. ansible.hosts
Resource definition
When I resize infrastructure one worker is removed , than I apply and terraform crashes with:
After terraform plan file content is changed because one worker node is removed. Is there any way to fix that ? |
Is there any update on this? We've updated to the most recent 1.0.X version of terraform and are still encountering this issue. |
Any updates or workaround yet anyone has found? |
It is intended behavior! You don't want to apply you plan if your infrastructure changed in-between! No difference what kind of resource you are using - |
That is not very automation friendly as you cannot simply run plan again there, instead there should be an option to ignore the inconsistency within the local_file provider |
Would the changed file happen between the plan and apply be in a different commit? because if its not in git it doesn't exist. (Read: the plan and apply should be done in CI only on the same code.) |
I've discovered a scenario in which Terraform will report the error
This is caused when you try to create a local_file that depends on the value read from a second file, and the second file changes between plan and apply. e.g. suppose you had:
if the contents of
greeting.txt
changes between plan and apply.Terraform Version
Affected Resource(s)
Steps to Reproduce
This bash script reliably reproduces the issue on my machine:
Debug Output
Debug and non-debug output: https://gist.github.com/alexwlchan/575770e8f391d474b3f4d5d242387cec
Panic Output
n/a
Expected Behavior
I'd get an error explaining that the resource pointed to by
file()
has changed, and so Terraform can't apply my change. Or, Terraform would use the original version of the file, as it was at plan time.Actual Behavior
I get an error telling me it's a provider bug.
Important Factoids
No.
References
This might be related to #57, which is a similar error. That ticket is marked "needs investigation", and I'm not sure if they're the same issue.
The text was updated successfully, but these errors were encountered: