0
votes

I'm looking into how to enable termination protection for EC2 instances in my ElasticBeanstalk environment configured with Terraform. I'm using an auto-scaling group and I've looked at the available launch configuration options and there's no disable_api_termination equivalent like there is in the terraform launch template.

The doc from the first link say "Your environment's instances are created using either an Amazon EC2 launch template or an Auto Scaling group launch configuration resource. These options work with both of these resource types."

Is there no way to enable EC2 instance termination protection in ElasticBeanstalk without needed to configure an EC2 launch template? It seems complicated to transfer from using the launch configuration to the launch template just to have the EC2 instance termination protection.

1

1 Answers

1
votes

There is no way to do it in a launch configuration since AutoScaling ignores that setting and will terminate your instances even if its enabled. You would have to use a launch template, and at that point I don't see much point in using beanstalk if your customizing everything.