Im having trouble applying changes to my AWS Batch configuration. As part of my batch cluster I use a custom Launch Template for the instances in the compute environment. However when I make a change to the Launch Template the Batch compute environment remains un-modified.
According to the AWS Batch docs, if the Launch Template is updated with a new version the entire compute environment needs to be destroyed and rebuilt:
AWS Batch does not support updating a compute environment with a new launch template version. If you update your launch template, you must create a new compute environment with the new template for the changes to take effect.
As a result, the only way to apply changes to the Launch Template is to manually destroy the compute environment before applying the plan.
I performed a quick search and I cannot find a way to trigger a forced re-create on a resource: #8099
Any fixes, help or work-arounds would be greatly appreciated.
Im using the following version of Terraform.
Terraform v0.13.3 + provider registry.terraform.io/-/aws v3.8.0 + provider registry.terraform.io/hashicorp/aws v3.8.0 + provider registry.terraform.io/hashicorp/null v2.1.2
Expected Behavior aws_batch_compute_environment resource using a modified
aws_launch_template resource is forced to be recreated
Actual Behavior aws_launch_template resources are updated in-place but
aws_batch_compute_environment resources remains unmodified