aws / aws/aws-cdk

AutoScaling: Validate use of Cooldown

Open
#32,667 4 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-autoscaling documentation effort/small feature-request p3
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

`Cooldown` only applies to simple scaling policy.
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-scalingpolicy.html#cfn-autoscaling-scalingpolicy-cooldown

Please consider enhancing CDK to trap for the following configuration when executed with the `--ci` switch.
To inform users that the cooldown will not have any effect.

asg.ScaleOnCpuUtilization('ALowCpuLoad', {
cooldown = cdk.Duration.minutes(666), // Has no effect when the policyType is `TargetTrackingScaling`
estimatedInstanceWarmup = cdk.Duration.minutes(10),
targetUtilizationPercent: 45
});

### Use Case

I was mislead by the CDK intrinsic documentation.

Cooldown: _Period after a scaling completes before another scaling activity can start.
Default: The default cooldown configured on the AutoScalingGroup._

### Proposed Solution

_No response_

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [X] This feature might incur a breaking change

### CDK version used

2.165.0

### Environment details (OS name and version, etc.)

Windows, C#, Constructs 10.4.2

Contributor guide

Open the contributing guide

Research direction

Start by tracing the ScaleOnCpuUtilization entry point and how CDK handles validation with the --ci switch. Confirm the behavior for TargetTrackingScaling versus simple scaling, then define a validation message for cooldown configurations that have no effect and verify it with focused validation coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.