Skip to content

(aws-autoscaling): support for terminationPolicies #15654

@nwalters512

Description

@nwalters512

I'd like to be able to configure the termination policies on an AutoScalingGroup.

Use Case

I'm currently using the L2 AutoScalingGroup construct. I can configure the termination policies with the L1 CfnAutoScalingGroup via the terminationPolicies prop, but I'd like to avoid falling back to the L1 construct if possible.

Proposed Solution

The solution could look as simple as this:

import * as autoscaling from '@aws-cdk/aws-autoscaling';

new autoscaling.AutoScalingGroup(this, 'ASG', {
  // ...
  terminationPolicies: ["ClosestToNextInstanceHour"],
};

For symmetry with other pieces of the CDK, the policies could be represented as an enum:

import * as autoscaling from '@aws-cdk/aws-autoscaling';

new autoscaling.AutoScalingGroup(this, 'ASG', {
  // ...
  terminationPolicies: [autoscaling.TerminationPolicy.CLOSEST_TO_NEXT_INSTANCE_HOUR],
};

Other

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-autoscalingRelated to Amazon EC2 Auto Scalingeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions