Class CfnScalingPolicy
The AWS::ApplicationAutoScaling::ScalingPolicy
resource defines a scaling policy that Application Auto Scaling uses to adjust the capacity of a scalable target.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnScalingPolicy : CfnResource, IInspectable
Syntax (vb)
Public Class CfnScalingPolicy
Inherits CfnResource
Implements IInspectable
Remarks
For more information, see Target tracking scaling policies and Step scaling policies in the Application Auto Scaling User Guide .
CloudformationResource: AWS::ApplicationAutoScaling::ScalingPolicy
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 cfnScalingPolicy = new CfnScalingPolicy(this, "MyCfnScalingPolicy", 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
CfnScalingPolicy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnScalingPolicy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CfnScalingPolicy(Construct, String, ICfnScalingPolicyProps) |
Properties
AttrArn | Returns the ARN of a scaling policy. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
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. |
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. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnScalingPolicy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnScalingPolicy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnScalingPolicy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnScalingPolicy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CfnScalingPolicy(Construct, String, ICfnScalingPolicyProps)
public CfnScalingPolicy(Construct scope, string id, ICfnScalingPolicyProps props)
Parameters
- scope Constructs.Construct
Scope in which this resource is defined.
- id System.String
Construct identifier for this resource (unique in its scope).
- props ICfnScalingPolicyProps
Resource properties.
Properties
AttrArn
Returns the ARN of a scaling policy.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Arn
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
PolicyName
The name of the scaling policy.
public virtual string PolicyName { get; set; }
Property Value
System.String
PolicyType
The scaling policy type.
public virtual string PolicyType { get; set; }
Property Value
System.String
ResourceId
The identifier of the resource associated with the scaling policy.
public virtual string ResourceId { get; set; }
Property Value
System.String
ScalableDimension
The scalable dimension.
public virtual string ScalableDimension { get; set; }
Property Value
System.String
Remarks
This string consists of the service namespace, resource type, and scaling property.
ScalingTargetId
The CloudFormation-generated ID of an Application Auto Scaling scalable target.
public virtual string ScalingTargetId { get; set; }
Property Value
System.String
ServiceNamespace
The namespace of the AWS service that provides the resource, or a custom-resource
.
public virtual string ServiceNamespace { get; set; }
Property Value
System.String
StepScalingPolicyConfiguration
A step scaling policy.
public virtual object StepScalingPolicyConfiguration { get; set; }
Property Value
System.Object
TargetTrackingScalingPolicyConfiguration
A target tracking scaling policy.
public virtual object TargetTrackingScalingPolicyConfiguration { get; set; }
Property Value
System.Object
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>