-
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
refresh doesn't update the fields of stopped AWS instances #3251
Comments
Hi @fatih - This sounds like reasonable logic to me, but I'd imagine it would be difficult to implement if it diverges from the behavior of the AWS API. Does |
Tagging as |
I've tested it with the So I've dived into the code and found that the API call returns a null response, instead of an empty string. For Example the I've tried to debugged it and found that we need to set it explicitly to an empty value. This is already the case for maps(https://github.com/hashicorp/terraform/blob/master/helper/schema/field_writer_map.go#L139) , but not for the primivite values. Here is the fix: #3257 |
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. |
Hi,
I've search the issue tracker but couldn't find any related issue. Please feel free to close if this is a duplicate. Having a simple
aws_instance
resource (full version: https://gist.github.com/fatih/e93aa6f6e9a763ec5957) in the form of:Because it doesn't have an
eip
, the Public IP will change in every stop/start switch. So the weird thing is, when the instance is stopped, and I callterraform refresh
, it still shows the old public IP:If I start the instance manually and call
terraform refresh
again, it goes and picks up the IP (which changed because it wasn't usingeip
, as expected):So my question is, why is the state not set to an empty value, if the instance is stopped and I call
terraform refresh
? I think this is a bug, but I'm not sure. So basically all I want is thatterraform show
to display the following when the instance is stopped and doesn't have any public IP anymore:Is this a wrong assumption?
The text was updated successfully, but these errors were encountered: