picatz / terraform-google-nomad

📗 Terraform Module for Nomad clusters with Consul on GCP
https://registry.terraform.io/modules/picatz/nomad/google
MIT License
78 stars 16 forks source link

Allow non-destructive updates #23

Closed pljeff closed 3 years ago

pljeff commented 3 years ago

Changing from metadata_startup_script to metadata.startup-script. metadata_startup_script is ForceNew, so when it is used, all GCP compute instances are destroyed and rebuilt. See hashicorp/terraform-provider-google#1081. With ForceNew, the nomad ACL infrastructure (as well as other data) is lost.

I have tested scaling the number of clients and confirmed that this change allows add/remove of clients without destroying the cluster. I have not tested if it is possible to scale the number of servers.

Also changed create_before_destroy as google_computer_instance does not appear to support creation of instances with the same name.

picatz commented 3 years ago

For the record, scaling servers also seems to work (scaling up, at the very least)!