terraform-google-bastion-host icon indicating copy to clipboard operation
terraform-google-bastion-host copied to clipboard

Add variable allow_stopping_for_update

Open intotecho opened this issue 3 years ago • 3 comments

TL;DR

So when terraform updates the host, say with a new startup script. terraform apply won't fail with

Error: Changing the machine_type, min_cpu_platform, service_account, enable_display, shielded_instance_config, scheduling.node_affinities or network_interface.[#d].(network/subnetwork/subnetwork_project) or advanced_machine_features on a started instance requires stopping it. To acknowledge this, please set allow_stopping_for_update = true in your config. You can also stop it by setting desired_status = "TERMINATED", but the instance will not be restarted after the update.

Terraform Resources

No response

Detailed design

No response

Additional information

No response

intotecho avatar Jul 28 '22 08:07 intotecho

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Sep 26 '22 23:09 github-actions[bot]

This would actually be pretty easy to implement, but what would be the point ? The instance would not start itself back up resulting in you having to go into the project and re-start it yourself anyway. It might be better to use metadata_startup_script for the startup script that way it will destroy the instance and recreate it from scratch leaving you with a running instance. But that would lead to other requirements.....

stevereaver avatar Sep 28 '22 05:09 stevereaver

I think adding a var to set allow_stopping_for_update is reasonable for this use case. Also, we encourage PRs if you're able to create one and I'll be happy to review it for you.

g-awmalik avatar Nov 09 '22 20:11 g-awmalik