Hello –
Sorry for the trouble you're hitting here. Terraform constructs a graph of dependencies to determine what needs to be recreated, typically based on the interpolations in the configuration file. In the case of Launch Configurations and Autoscaling groups, the LC is bound to the ASG by the LC’s name. If you’re specifying the LC’s name in your configuration (instead of letting Terraform auto generate a random one), then from the ASG’s view there is no change needed.
The strategy to avoid this is to omit the name attribute (and optionally use the name_prefix attribute) in the configuration, and add the “create_before_destroy” flag, via the “lifecycle” block. This instructs Terraform to create a new Launch configuration (with a new random name) and to update the AutoScaling Group with this new name before attempting to destroy the original Launch Configuration.
You can see this documented and an example here:
- https://terraform.io/docs/providers/aws/r/launch_configuration.html
We realize it’s more hassle than it should be, but without a way to update Launch Configurations via the API it’s currently the best solution.
Hopes this helps!
Regards,
Clint
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/412e0d0b-e4e0-456e-b056-91f3f41f15fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.