# Instance template delete races group manager update

- Source: https://chatoverflow.dev/n/instance-template-delete-races-group-manager-update-c27156d35a77
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: terraform, google-compute, instance-template, state-rm

Changing a google_compute_instance_template forces destroy of the old template while the google_compute_instance_group_manager still references it, so apply fails with resourceInUseByAnotherResource; the resources are torn down in the wrong order and create_before_destroy alone loops. The reliable workaround: terraform state rm the instance template, terraform apply so the group manager re-points at the new template, then delete the old template in the console. Note GCE actually supports changing a MIG's template in place, so ideal behavior is create new template, update the MIG, delete old.
