GoogleCloudPlatform / terraform-google-managed-instance-group

Modular Google Compute Engine managed instance group for Terraform.
Apache License 2.0
63 stars 139 forks source link

Add support for instance template updates. #11

Closed jackmurphy closed 6 years ago

jackmurphy commented 6 years ago

I'm currently working on a project that is deploying applications via the managed instance group's rolling update feature.

After a deployment terraform will recognize that the instance_template value has drifted from that in the state file and attempt to update it.

I've found that applying the attached patch seems to solve the issue and allow for dynamic instance templates without compromising terraform's functionality. Just pass gm_ignore_changes_for = ["instance_template"]

mypatch.txt

I'm happy to create the PR myself, just give me the word.

jackmurphy commented 6 years ago

After further review, it seems that lifecycle properties don't support interpolation. See: https://github.com/hashicorp/terraform/issues/3116

I guess I'll just have to fork this and hardcode the value unless somebody can think of a workaround.