-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
compute_instance: desired_state can only accept RUNNING value #16586
compute_instance: desired_state can only accept RUNNING value #16586
Comments
@eraac I tested on v4.5.0 and received the same error. Can you share the debug log for your apply on pre v5? |
I just retry with the same version as my first apply (version 4.58) ... and got the same issue. I guess the first time I've probably set the desired_status after the first apply and didn't encounter this issue I think we can transform this issue from
|
@eraac I doubt there is much we can do in the Terraform. Are you able to create a brand new TERMINATED instance with other means, like gcloud? |
If Terraform can turn off the instance on the second apply, I presume it can also turn it off in the first apply (I don't mind if the instance turn on for a few seconds). Similar to the way the The real problem is the double apply + the manual edit required to have the desired state |
Theoretically I think yes a second call is added to change the state in the create. But I am not sure if that use case has high demand. @zli82016 what do you think? |
Technically it is doable, but I don't think this use case has high demand. Normally, users don't want to create a instance and then immediacy terminate it. |
The request seems to be not potentially useful for users. I want the ticket to be retriaged. |
Note from triage: We're ok with the resource being updated to allow creation of terminated VMs |
I saw that this can also hamper terraform deletion. Lets consider that we are creating a gcp instance and also a vault approle simultaneously. Steps to reproduce
Even though the instance has been deleted. |
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. |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
The instance should be created and turn-off
Actual Behavior
The terraform apply return an error
Steps to Reproduce
terraform apply
Important Factoids
References
Notes
I was able to create this resource with the same configuration before (probably before v5), furthermore the documentation mention the
TERMINATED
as a valid value.b/313620109
The text was updated successfully, but these errors were encountered: