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
[Bug]: "Terraform detected the following changes made outside" for changes made inside. #37149
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
@halberom Just out of curiosity, does it help when putting these arguments in |
@aristosvo I was pretty sure it wouldn't, but double checked to be sure and no luck. Things like instance_state in aws_instance is a returned attribute, not a parameter. So while it can be added without error, I'm not sure it'd do anything regardless. Also ignore_changes is intended for use when external systems/users might make changes to a managed resource - to stop it from overriding/reverting back to state. That's not the case here - Terraform isn't trying to apply/revert changes, it has in fact already made them. My current workaround is to use the following logic in my Makefile
which successfully forces a state refresh silently. adds a few seconds to runtime but I can live with it. |
I didn't expect that to work as well, but wasn't sure 👍🏽 It feels like this is a Terraform Core issue, not something a provider will be able to resolve. This issue seems to cover it, but only offers your already used suggestion. |
Yes quite possible. I was assuming that the provider code determined what state would be recorded for a given resource, given it's what takes the parameters, makes the api calls, and receives the responses. |
Terraform Core Version
1.6.2
AWS Provider Version
5.45.0
Affected Resource(s)
that I'm aware of so far.
Expected Behavior
Terraform should only display changes under
Terraform detected the following changes made outside of Terraform since the last "terraform apply"...
when someone or something changes resources managed by Terraform outside of Terraform.Also
Entities and their metadata should be listed only once in state or all matching entities should be updated at the same time if a change occurs.
Actual Behavior
Terraform shows
Terraform detected the following changes made outside of Terraform since the last "terraform apply"...
for changes applied by Terraform.Probably because entities are saved in state inline and within standalone resources, but only the standalone resource gets updated during an applied change. Subsequent plans show "Terraform detected the following changes..." because the inline data has not been updated.
example combinations I've found so far include
Relevant Error/Panic Output Snippet
The following output is after changing instance state from stopped to running.
excerpt from state file:
Terraform Configuration Files
https://gist.github.com/halberom/4a4aaabda189df511d32926986968268
Steps to Reproduce
See the example gist, or you can verify/test with any of the combinations (and probably others) mentioned above.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
related to #22317 and #26161
I also raised https://discuss.hashicorp.com/t/query-re-entities-listed-twice-in-state-when-they-can-be-inline-but-are-created-as-individual-resources/64794 to ask about this.
Would you like to implement a fix?
No
The text was updated successfully, but these errors were encountered: