interface BasicTargetTrackingScalingPolicyProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AutoScaling.BasicTargetTrackingScalingPolicyProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#BasicTargetTrackingScalingPolicyProps |
Java | software.amazon.awscdk.services.autoscaling.BasicTargetTrackingScalingPolicyProps |
Python | aws_cdk.aws_autoscaling.BasicTargetTrackingScalingPolicyProps |
TypeScript (source) | aws-cdk-lib » aws_autoscaling » BasicTargetTrackingScalingPolicyProps |
Properties for a Target Tracking policy that include the metric but exclude the target.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_autoscaling as autoscaling } from 'aws-cdk-lib';
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
declare const metric: cloudwatch.Metric;
const basicTargetTrackingScalingPolicyProps: autoscaling.BasicTargetTrackingScalingPolicyProps = {
targetValue: 123,
// the properties below are optional
cooldown: cdk.Duration.minutes(30),
customMetric: metric,
disableScaleIn: false,
estimatedInstanceWarmup: cdk.Duration.minutes(30),
predefinedMetric: autoscaling.PredefinedMetric.ASG_AVERAGE_CPU_UTILIZATION,
resourceLabel: 'resourceLabel',
};
Properties
Name | Type | Description |
---|---|---|
target | number | The target value for the metric. |
cooldown? | Duration | Period after a scaling completes before another scaling activity can start. |
custom | IMetric | A custom metric for application autoscaling. |
disable | boolean | Indicates whether scale in by the target tracking policy is disabled. |
estimated | Duration | Estimated time until a newly launched instance can send metrics to CloudWatch. |
predefined | Predefined | A predefined metric for application autoscaling. |
resource | string | The resource label associated with the predefined metric. |
targetValue
Type:
number
The target value for the metric.
cooldown?
Type:
Duration
(optional, default: The default cooldown configured on the AutoScalingGroup.)
Period after a scaling completes before another scaling activity can start.
customMetric?
Type:
IMetric
(optional, default: No custom metric.)
A custom metric for application autoscaling.
The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.
Exactly one of customMetric or predefinedMetric must be specified.
disableScaleIn?
Type:
boolean
(optional, default: false)
Indicates whether scale in by the target tracking policy is disabled.
If the value is true, scale in is disabled and the target tracking policy won't remove capacity from the autoscaling group. Otherwise, scale in is enabled and the target tracking policy can remove capacity from the group.
estimatedInstanceWarmup?
Type:
Duration
(optional, default: Same as the cooldown.)
Estimated time until a newly launched instance can send metrics to CloudWatch.
predefinedMetric?
Type:
Predefined
(optional, default: No predefined metric.)
A predefined metric for application autoscaling.
The metric must track utilization. Scaling out will happen if the metric is higher than the target value, scaling in will happen in the metric is lower than the target value.
Exactly one of customMetric or predefinedMetric must be specified.
resourceLabel?
Type:
string
(optional, default: No resource label.)
The resource label associated with the predefined metric.
Should be supplied if the predefined metric is ALBRequestCountPerTarget, and the format should be:
app/<load-balancer-name>/<load-balancer-id>/targetgroup/<target-group-name>/<target-group-id>