terraform-google-modules/terraform-google-bastion-host

Add variable allow_stopping_for_update

intotecho opened this issue · 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

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

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.....

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.