Class CfnScalingPolicy.TargetTrackingConfigurationProperty
TargetTrackingConfiguration
is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Amazon EC2 Auto Scaling.
Inherited Members
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnScalingPolicy.TargetTrackingConfigurationProperty : CfnScalingPolicy.ITargetTrackingConfigurationProperty
Syntax (vb)
Public Class CfnScalingPolicy.TargetTrackingConfigurationProperty Implements CfnScalingPolicy.ITargetTrackingConfigurationProperty
Remarks
For more information about scaling policies, see Dynamic scaling in the Amazon EC2 Auto Scaling User Guide .
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.AWS.AutoScaling;
var targetTrackingConfigurationProperty = new TargetTrackingConfigurationProperty {
TargetValue = 123,
// the properties below are optional
CustomizedMetricSpecification = new CustomizedMetricSpecificationProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Metrics = new [] { new TargetTrackingMetricDataQueryProperty {
Id = "id",
// the properties below are optional
Expression = "expression",
Label = "label",
MetricStat = new TargetTrackingMetricStatProperty {
Metric = new MetricProperty {
MetricName = "metricName",
Namespace = "namespace",
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} }
},
Stat = "stat",
// the properties below are optional
Period = 123,
Unit = "unit"
},
Period = 123,
ReturnData = false
} },
Namespace = "namespace",
Period = 123,
Statistic = "statistic",
Unit = "unit"
},
DisableScaleIn = false,
PredefinedMetricSpecification = new PredefinedMetricSpecificationProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
}
};
Synopsis
Constructors
TargetTrackingConfigurationProperty() |
|
Properties
CustomizedMetricSpecification | A customized metric. |
DisableScaleIn | Indicates whether scaling in by the target tracking scaling policy is disabled. |
PredefinedMetricSpecification | A predefined metric. |
TargetValue | The target value for the metric. |
Constructors
TargetTrackingConfigurationProperty()
TargetTrackingConfiguration
is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Amazon EC2 Auto Scaling.
public TargetTrackingConfigurationProperty()
Remarks
For more information about scaling policies, see Dynamic scaling in the Amazon EC2 Auto Scaling User Guide .
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.AWS.AutoScaling;
var targetTrackingConfigurationProperty = new TargetTrackingConfigurationProperty {
TargetValue = 123,
// the properties below are optional
CustomizedMetricSpecification = new CustomizedMetricSpecificationProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Metrics = new [] { new TargetTrackingMetricDataQueryProperty {
Id = "id",
// the properties below are optional
Expression = "expression",
Label = "label",
MetricStat = new TargetTrackingMetricStatProperty {
Metric = new MetricProperty {
MetricName = "metricName",
Namespace = "namespace",
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} }
},
Stat = "stat",
// the properties below are optional
Period = 123,
Unit = "unit"
},
Period = 123,
ReturnData = false
} },
Namespace = "namespace",
Period = 123,
Statistic = "statistic",
Unit = "unit"
},
DisableScaleIn = false,
PredefinedMetricSpecification = new PredefinedMetricSpecificationProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
}
};
Properties
CustomizedMetricSpecification
A customized metric.
public object? CustomizedMetricSpecification { get; set; }
Property Value
Remarks
You must specify either a predefined metric or a customized metric.
DisableScaleIn
Indicates whether scaling in by the target tracking scaling policy is disabled.
public object? DisableScaleIn { get; set; }
Property Value
Remarks
If scaling in is disabled, the target tracking scaling policy doesn't remove instances from the Auto Scaling group. Otherwise, the target tracking scaling policy can remove instances from the Auto Scaling group. The default is false
.
PredefinedMetricSpecification
A predefined metric.
public object? PredefinedMetricSpecification { get; set; }
Property Value
Remarks
You must specify either a predefined metric or a customized metric.
TargetValue
The target value for the metric.
public double TargetValue { get; set; }
Property Value
Remarks
Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval.