Skip to content

Support LifecycleHookSpecificationList for the L2 AutoScalingGroup construct #7712

Open
@RikJansen81

Description

@RikJansen81

AutoScalingGroup#addLifecycleHook inserts a LifeCycleHook-resrouce in the CFN-template that depends on the referenced ASG. This will result in the hook being created after the initial ASG (and its instances) have been created. Therefore, the hooks are not triggered for these initial instances.

CFN allows the use of LifecycleHookSpecificationList in the ASG specification. These hooks will also fire for the instances in the initial group.

Use Case

I would like my hooks to be triggered for all instances in my ASG, not only after a scaling event.

Proposed Solution

Extend interface AutoScalingGroupProps with property lifecycleHookSpecificationList and render according specifications.

There are two "reasonable" workarounds:

  1. Use the Cfn-classes
  2. Deploy first with desiredCapacity = 0, and then again with the desired desiredCapacity.
  • 👋 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/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions