-
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
Removing overridden default value does not trigger diff #4501
Comments
The In user-oriented terms, this means that the value is optional but if you don't specify it then its value isn't known until after the object has been created, since the default is defined by the remote API. Once a resource has been created, Terraform will just accept whatever value the server currently has unless you specifically override it. The trick with this sort of attribute is that Terraform uses the presence or absense of the configuration as the trigger to decide whether you want to accept the server's default or override your own. When you removed the While I agree this is a little surprising, it is the intended behavior. It doesn't help that the Terraform docs don't really ever talk about this special Optional+Computed case; perhaps we could consider this a ticket to clarify this somehow in the documentation? |
That explanation makes sense. Would definitely be nice to have this explained somewhere in the docs. |
Since this is a very old issue, and the AWS provider documentation is in the aws provider repository, I am going to close this issue. If this is still a problem, please open a new issue with the aws provider. Thanks! |
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. |
Let's say I have the following VPC definition:
I've set
enable_dns_hostnames
totrue
, overriding the default value offalse
. I apply the changes and go on my way. A little while later I decide that I don't want to enable DNS hostnames after all, so I remove that line, assuming that it will revert to the default offalse
. But when I runterraform plan
it tells me that no changes were detected. In order to trigger a diff detection I have to explicitly setenable_dns_hostnames
tofalse
, which seems wrong.The text was updated successfully, but these errors were encountered: