I'm using "T2 Unlimited" instances with my AWS Elastic Beanstalk configuration.

The default instance termination policy (for when scaling down) terminates the oldest instances first. This is bad because the oldest instances are the ones most likely to have CPU credits built-up. I would like to change the instance termination policy to "newest first."

I tried this:

    TerminationPolicies: [

But got error:

Invalid option specification (Namespace: 'aws:autoscaling:asg', OptionName: 'TerminationPolicies'): Unknown configuration setting.

This isn't too surprising since this option isn't listed as a valid option.

So how can I make so when Beanstalk creates a new auto-scaling-group for an environment, it automatically sets the termination policy to newest first?

Perhaps this is unnecessary because auto-scaling-groups are only created when the environment is created?


The following works for me. I use .ebextensions folder to configure my apps. Inside I have created a termination.config file containing this:

        Type: "AWS::AutoScaling::AutoScalingGroup"
          TerminationPolicies: [ "OldestInstance" ]
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.