Class BasicTargetTrackingScalingPolicyProps
Properties for a Target Tracking policy that include the metric but exclude the target.
Inherited Members
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BasicTargetTrackingScalingPolicyProps : IBasicTargetTrackingScalingPolicyProps, IBaseTargetTrackingProps
Syntax (vb)
Public Class BasicTargetTrackingScalingPolicyProps Implements IBasicTargetTrackingScalingPolicyProps, IBaseTargetTrackingProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.CloudWatch;
Metric metric;
var basicTargetTrackingScalingPolicyProps = new BasicTargetTrackingScalingPolicyProps {
TargetValue = 123,
// the properties below are optional
Cooldown = Duration.Minutes(30),
CustomMetric = metric,
DisableScaleIn = false,
EstimatedInstanceWarmup = Duration.Minutes(30),
PredefinedMetric = PredefinedMetric.ASG_AVERAGE_CPU_UTILIZATION,
ResourceLabel = "resourceLabel"
};
Synopsis
Constructors
BasicTargetTrackingScalingPolicyProps() | Properties for a Target Tracking policy that include the metric but exclude the target. |
Properties
Cooldown | Period after a scaling completes before another scaling activity can start. |
CustomMetric | A custom metric for application autoscaling. |
DisableScaleIn | Indicates whether scale in by the target tracking policy is disabled. |
EstimatedInstanceWarmup | Estimated time until a newly launched instance can send metrics to CloudWatch. |
PredefinedMetric | A predefined metric for application autoscaling. |
ResourceLabel | The resource label associated with the predefined metric. |
TargetValue | The target value for the metric. |
Constructors
BasicTargetTrackingScalingPolicyProps()
Properties for a Target Tracking policy that include the metric but exclude the target.
public BasicTargetTrackingScalingPolicyProps()
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
using Amazon.CDK.AWS.AutoScaling;
using Amazon.CDK.AWS.CloudWatch;
Metric metric;
var basicTargetTrackingScalingPolicyProps = new BasicTargetTrackingScalingPolicyProps {
TargetValue = 123,
// the properties below are optional
Cooldown = Duration.Minutes(30),
CustomMetric = metric,
DisableScaleIn = false,
EstimatedInstanceWarmup = Duration.Minutes(30),
PredefinedMetric = PredefinedMetric.ASG_AVERAGE_CPU_UTILIZATION,
ResourceLabel = "resourceLabel"
};
Properties
Cooldown
Period after a scaling completes before another scaling activity can start.
public Duration? Cooldown { get; set; }
Property Value
Remarks
Default: - The default cooldown configured on the AutoScalingGroup.
CustomMetric
A custom metric for application autoscaling.
public IMetric? CustomMetric { get; set; }
Property Value
Remarks
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.
Default: - No custom metric.
DisableScaleIn
Indicates whether scale in by the target tracking policy is disabled.
public bool? DisableScaleIn { get; set; }
Property Value
bool?
Remarks
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.
Default: false
EstimatedInstanceWarmup
Estimated time until a newly launched instance can send metrics to CloudWatch.
public Duration? EstimatedInstanceWarmup { get; set; }
Property Value
Remarks
Default: - Same as the cooldown.
PredefinedMetric
A predefined metric for application autoscaling.
public PredefinedMetric? PredefinedMetric { get; set; }
Property Value
Remarks
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.
Default: - No predefined metric.
ResourceLabel
The resource label associated with the predefined metric.
public string? ResourceLabel { get; set; }
Property Value
Remarks
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>
Default: - No resource label.
TargetValue
The target value for the metric.
public double TargetValue { get; set; }
Property Value
Remarks
ExampleMetadata: fixture=_generated