Support LifecycleHookSpecificationList for the L2 AutoScalingGroup construct
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
`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`.
* [x] :wave: I may be able to implement this feature request
* [ ] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Locate the L2 AutoScalingGroup construct, its AutoScalingGroupProps interface, and the addLifecycleHook implementation. Compare how lifecycle hooks are rendered into the CloudFormation template, then inspect existing construct tests for the expected template assertions. Done means lifecycleHookSpecificationList is accepted and rendered so hooks apply to the initial instances.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100