Class CfnScalingPolicyProps
Properties for defining a CfnScalingPolicy
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnScalingPolicyProps : Object, ICfnScalingPolicyProps
Syntax (vb)
Public Class CfnScalingPolicyProps
Inherits Object
Implements ICfnScalingPolicyProps
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.AWS.ApplicationAutoScaling;
var cfnScalingPolicyProps = new CfnScalingPolicyProps {
PolicyName = "policyName",
PolicyType = "policyType",
// the properties below are optional
ResourceId = "resourceId",
ScalableDimension = "scalableDimension",
ScalingTargetId = "scalingTargetId",
ServiceNamespace = "serviceNamespace",
StepScalingPolicyConfiguration = new StepScalingPolicyConfigurationProperty {
AdjustmentType = "adjustmentType",
Cooldown = 123,
MetricAggregationType = "metricAggregationType",
MinAdjustmentMagnitude = 123,
StepAdjustments = new [] { new StepAdjustmentProperty {
ScalingAdjustment = 123,
// the properties below are optional
MetricIntervalLowerBound = 123,
MetricIntervalUpperBound = 123
} }
},
TargetTrackingScalingPolicyConfiguration = new TargetTrackingScalingPolicyConfigurationProperty {
TargetValue = 123,
// the properties below are optional
CustomizedMetricSpecification = new CustomizedMetricSpecificationProperty {
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Metrics = new [] { new TargetTrackingMetricDataQueryProperty {
Expression = "expression",
Id = "id",
Label = "label",
MetricStat = new TargetTrackingMetricStatProperty {
Metric = new TargetTrackingMetricProperty {
Dimensions = new [] { new TargetTrackingMetricDimensionProperty {
Name = "name",
Value = "value"
} },
MetricName = "metricName",
Namespace = "namespace"
},
Stat = "stat",
Unit = "unit"
},
ReturnData = false
} },
Namespace = "namespace",
Statistic = "statistic",
Unit = "unit"
},
DisableScaleIn = false,
PredefinedMetricSpecification = new PredefinedMetricSpecificationProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
},
ScaleInCooldown = 123,
ScaleOutCooldown = 123
}
};
Synopsis
Constructors
CfnScalingPolicyProps() |
Properties
PolicyName | The name of the scaling policy. |
PolicyType | The scaling policy type. |
ResourceId | The identifier of the resource associated with the scaling policy. |
ScalableDimension | The scalable dimension. This string consists of the service namespace, resource type, and scaling property. |
ScalingTargetId | The CloudFormation-generated ID of an Application Auto Scaling scalable target. |
ServiceNamespace | The namespace of the AWS service that provides the resource, or a |
StepScalingPolicyConfiguration | A step scaling policy. |
TargetTrackingScalingPolicyConfiguration | A target tracking scaling policy. |
Constructors
CfnScalingPolicyProps()
public CfnScalingPolicyProps()
Properties
PolicyName
The name of the scaling policy.
public string PolicyName { get; set; }
Property Value
System.String
Remarks
Updates to the name of a target tracking scaling policy are not supported, unless you also update the metric used for scaling. To change only a target tracking scaling policy's name, first delete the policy by removing the existing AWS::ApplicationAutoScaling::ScalingPolicy
resource from the template and updating the stack. Then, recreate the resource with the same settings and a different name.
PolicyType
The scaling policy type.
public string PolicyType { get; set; }
Property Value
System.String
Remarks
The following policy types are supported:
TargetTrackingScaling
—Not supported for Amazon EMR
StepScaling
—Not supported for DynamoDB, Amazon Comprehend, Lambda, Amazon Keyspaces, Amazon MSK, Amazon ElastiCache, or Neptune.
ResourceId
The identifier of the resource associated with the scaling policy.
public string ResourceId { get; set; }
Property Value
System.String
Remarks
This string consists of the resource type and unique identifier.
ScalableDimension
The scalable dimension. This string consists of the service namespace, resource type, and scaling property.
public string ScalableDimension { get; set; }
Property Value
System.String
Remarks
ScalingTargetId
The CloudFormation-generated ID of an Application Auto Scaling scalable target.
public string ScalingTargetId { get; set; }
Property Value
System.String
Remarks
For more information about the ID, see the Return Value section of the AWS::ApplicationAutoScaling::ScalableTarget
resource.
You must specify either the ScalingTargetId
property, or the ResourceId
, ScalableDimension
, and ServiceNamespace
properties, but not both.
ServiceNamespace
The namespace of the AWS service that provides the resource, or a custom-resource
.
public string ServiceNamespace { get; set; }
Property Value
System.String
Remarks
StepScalingPolicyConfiguration
A step scaling policy.
public object StepScalingPolicyConfiguration { get; set; }
Property Value
System.Object
Remarks
TargetTrackingScalingPolicyConfiguration
A target tracking scaling policy.
public object TargetTrackingScalingPolicyConfiguration { get; set; }
Property Value
System.Object