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:
option_settings: aws:autoscaling:asg: TerminationPolicies: [ "NewestInstance" ]
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?