Class CfnScalingPolicy
A CloudFormation AWS::ApplicationAutoScaling::ScalingPolicy
.
Inherited Members
Namespace: Amazon.CDK.AWS.ApplicationAutoScaling
Assembly: Amazon.CDK.AWS.ApplicationAutoScaling.dll
Syntax (csharp)
public class CfnScalingPolicy : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnScalingPolicy
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::ApplicationAutoScaling::ScalingPolicy
resource defines a scaling policy that Application Auto Scaling uses to adjust the capacity of a scalable target.
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 {
MetricName = "metricName",
Namespace = "namespace",
Statistic = "statistic",
// the properties below are optional
Dimensions = new [] { new MetricDimensionProperty {
Name = "name",
Value = "value"
} },
Unit = "unit"
},
DisableScaleIn = false,
PredefinedMetricSpecification = new PredefinedMetricSpecificationProperty {
PredefinedMetricType = "predefinedMetricType",
// the properties below are optional
ResourceLabel = "resourceLabel"
},
ScaleInCooldown = 123,
ScaleOutCooldown = 123
}
});
Synopsis
Constructors
CfnScalingPolicy(Construct, String, ICfnScalingPolicyProps) | Create a new |
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 |
Properties
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. 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. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnScalingPolicy(Construct, String, ICfnScalingPolicyProps)
Create a new AWS::ApplicationAutoScaling::ScalingPolicy
.
public CfnScalingPolicy(Construct scope, string id, ICfnScalingPolicyProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnScalingPolicyProps
- resource properties.
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
Properties
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
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 virtual 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 virtual 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 virtual string ScalableDimension { get; set; }
Property Value
System.String
Remarks
ScalingTargetId
The CloudFormation-generated ID of an Application Auto Scaling scalable target.
public virtual 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 virtual string ServiceNamespace { get; set; }
Property Value
System.String
Remarks
StepScalingPolicyConfiguration
A step scaling policy.
public virtual object StepScalingPolicyConfiguration { get; set; }
Property Value
System.Object
Remarks
TargetTrackingScalingPolicyConfiguration
A target tracking scaling policy.
public virtual object TargetTrackingScalingPolicyConfiguration { get; set; }
Property Value
System.Object
Remarks
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>