You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like you've found a specific case here of the general problem described in #17034 (under "When Data Resource Arguments change"). Terraform is unfortunately behaving as designed here -- refreshing always happens before taking into account changes to resource configurations -- but that other issue is a proposal to change that design to perform both refreshing and planning at once so that the refresh actions (which include reading data sources) can take into account changes to resource instances that we plan to make during the apply step.
Since we have #17034 open tracking the proposal we're going to close this just to consolidate the discussion, but this extensive writeup will make a good test case to evaluate future design iterations and a final implementation of #17034 against, so we very much appreciate you taking the time to write it up in detail!
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.
ghost
locked and limited conversation to collaborators
Mar 28, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
Terraform Configuration Files
First Run
Second and Third Runs
Debug Output
First run: https://gist.github.com/tabacco/cc621d82e8fad758402fe8fcdc3d708d
Second run: https://gist.github.com/tabacco/00cfd84fec5b3e058b40906ffdb7dabb
Third run: https://gist.github.com/tabacco/3b06c75f99cc46e53882027ad198b97e
Expected Behavior
On the second apply, I would expect "secret-two" to be deleted, and the policy json to be updated to remove "secret-two"
Actual Behavior
On the second apply "secret-two" is deleted but the policy json is unchanged. On the third apply the policy json is updated correctly.
These are the plans from the second and third runs (I've omitted the first, since it works as expected):
Second Run
Third Run
Steps to Reproduce
terraform init
terraform apply
terraform apply
terraform apply
Additional Context
Nothing interesting to report, just vanilla terraform with for_each.
References
The text was updated successfully, but these errors were encountered: