Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoScaling: Validate use of Cooldown #32667

Open
1 of 2 tasks
ryanwilliams83 opened this issue Dec 27, 2024 · 1 comment
Open
1 of 2 tasks

AutoScaling: Validate use of Cooldown #32667

ryanwilliams83 opened this issue Dec 27, 2024 · 1 comment
Assignees
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling feature-request A feature should be added or improved. investigating This issue is being investigated and/or work is in progress to resolve the issue. p2

Comments

@ryanwilliams83
Copy link

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
  • 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

@ryanwilliams83 ryanwilliams83 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 27, 2024
@github-actions github-actions bot added the @aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling label Dec 27, 2024
@ryanwilliams83
Copy link
Author

An example of some synthesized CloudFormation containing Cooldown and also TargetTrackingScaling.

    "AutoScalingGroupScalingPolicyALowCpuLoadE60B7782": {
      "Type": "AWS::AutoScaling::ScalingPolicy",
      "Properties": {
        "AutoScalingGroupName": {
          "Ref": "AutoScalingGroupASG804C35BE"
        },
        "Cooldown": "1500",
        "EstimatedInstanceWarmup": 1200,
        "PolicyType": "TargetTrackingScaling",
        "TargetTrackingConfiguration": {
          "PredefinedMetricSpecification": {
            "PredefinedMetricType": "ASGAverageCPUUtilization"
          },
          "TargetValue": 45
        }
      },
      "DependsOn": [
        "AutoScalingGroupWarmPool7145D5D8",
        "SsmParameterCloudWatchAgentConfig"
      ],
      "Metadata": {
        "aws:cdk:path": "GisMaps/AutoScalingGroup/ScalingPolicyALowCpuLoad/Resource"
      }
    },

@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 27, 2024
@khushail khushail self-assigned this Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-autoscaling Related to Amazon EC2 Auto Scaling feature-request A feature should be added or improved. investigating This issue is being investigated and/or work is in progress to resolve the issue. p2
Projects
None yet
Development

No branches or pull requests

2 participants