Class CfnScalingPolicy
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.applicationautoscaling.CfnScalingPolicy
- All Implemented Interfaces:
IInspectable,IScalingPolicyRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)",
date="2025-10-14T12:28:04.696Z")
@Stability(Stable)
public class CfnScalingPolicy
extends CfnResource
implements IInspectable, IScalingPolicyRef
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.applicationautoscaling.*;
CfnScalingPolicy cfnScalingPolicy = CfnScalingPolicy.Builder.create(this, "MyCfnScalingPolicy")
.policyName("policyName")
.policyType("policyType")
// the properties below are optional
.predictiveScalingPolicyConfiguration(PredictiveScalingPolicyConfigurationProperty.builder()
.metricSpecifications(List.of(PredictiveScalingMetricSpecificationProperty.builder()
.targetValue(123)
// the properties below are optional
.customizedCapacityMetricSpecification(PredictiveScalingCustomizedCapacityMetricProperty.builder()
.metricDataQueries(List.of(PredictiveScalingMetricDataQueryProperty.builder()
.expression("expression")
.id("id")
.label("label")
.metricStat(PredictiveScalingMetricStatProperty.builder()
.metric(PredictiveScalingMetricProperty.builder()
.dimensions(List.of(PredictiveScalingMetricDimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.build())
.customizedLoadMetricSpecification(PredictiveScalingCustomizedLoadMetricProperty.builder()
.metricDataQueries(List.of(PredictiveScalingMetricDataQueryProperty.builder()
.expression("expression")
.id("id")
.label("label")
.metricStat(PredictiveScalingMetricStatProperty.builder()
.metric(PredictiveScalingMetricProperty.builder()
.dimensions(List.of(PredictiveScalingMetricDimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.build())
.customizedScalingMetricSpecification(PredictiveScalingCustomizedScalingMetricProperty.builder()
.metricDataQueries(List.of(PredictiveScalingMetricDataQueryProperty.builder()
.expression("expression")
.id("id")
.label("label")
.metricStat(PredictiveScalingMetricStatProperty.builder()
.metric(PredictiveScalingMetricProperty.builder()
.dimensions(List.of(PredictiveScalingMetricDimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.build())
.predefinedLoadMetricSpecification(PredictiveScalingPredefinedLoadMetricProperty.builder()
.predefinedMetricType("predefinedMetricType")
// the properties below are optional
.resourceLabel("resourceLabel")
.build())
.predefinedMetricPairSpecification(PredictiveScalingPredefinedMetricPairProperty.builder()
.predefinedMetricType("predefinedMetricType")
// the properties below are optional
.resourceLabel("resourceLabel")
.build())
.predefinedScalingMetricSpecification(PredictiveScalingPredefinedScalingMetricProperty.builder()
.predefinedMetricType("predefinedMetricType")
// the properties below are optional
.resourceLabel("resourceLabel")
.build())
.build()))
// the properties below are optional
.maxCapacityBreachBehavior("maxCapacityBreachBehavior")
.maxCapacityBuffer(123)
.mode("mode")
.schedulingBufferTime(123)
.build())
.resourceId("resourceId")
.scalableDimension("scalableDimension")
.scalingTargetId("scalingTargetId")
.serviceNamespace("serviceNamespace")
.stepScalingPolicyConfiguration(StepScalingPolicyConfigurationProperty.builder()
.adjustmentType("adjustmentType")
.cooldown(123)
.metricAggregationType("metricAggregationType")
.minAdjustmentMagnitude(123)
.stepAdjustments(List.of(StepAdjustmentProperty.builder()
.scalingAdjustment(123)
// the properties below are optional
.metricIntervalLowerBound(123)
.metricIntervalUpperBound(123)
.build()))
.build())
.targetTrackingScalingPolicyConfiguration(TargetTrackingScalingPolicyConfigurationProperty.builder()
.targetValue(123)
// the properties below are optional
.customizedMetricSpecification(CustomizedMetricSpecificationProperty.builder()
.dimensions(List.of(MetricDimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.metrics(List.of(TargetTrackingMetricDataQueryProperty.builder()
.expression("expression")
.id("id")
.label("label")
.metricStat(TargetTrackingMetricStatProperty.builder()
.metric(TargetTrackingMetricProperty.builder()
.dimensions(List.of(TargetTrackingMetricDimensionProperty.builder()
.name("name")
.value("value")
.build()))
.metricName("metricName")
.namespace("namespace")
.build())
.stat("stat")
.unit("unit")
.build())
.returnData(false)
.build()))
.namespace("namespace")
.statistic("statistic")
.unit("unit")
.build())
.disableScaleIn(false)
.predefinedMetricSpecification(PredefinedMetricSpecificationProperty.builder()
.predefinedMetricType("predefinedMetricType")
// the properties below are optional
.resourceLabel("resourceLabel")
.build())
.scaleInCooldown(123)
.scaleOutCooldown(123)
.build())
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnScalingPolicy.static interfaceContains customized metric specification information for a target tracking scaling policy for Application Auto Scaling.static interfaceMetricDimensionspecifies a name/value pair that is part of the identity of a CloudWatch metric for theDimensionsproperty of the AWS::ApplicationAutoScaling::ScalingPolicy CustomizedMetricSpecification property type.static interfaceContains predefined metric specification information for a target tracking scaling policy for Application Auto Scaling.static interfaceRepresents a CloudWatch metric of your choosing for a predictive scaling policy.static interfaceThe customized load metric specification.static interfaceOne or more metric data queries to provide data points for a metric specification.static interfaceThe metric data to return.static interfaceDescribes the dimension of a metric.static interfaceDescribes the scaling metric.static interfaceThis structure specifies the metrics and target utilization settings for a predictive scaling policy.static interfaceThis structure defines the CloudWatch metric to return, along with the statistic and unit.static interfaceRepresents a predictive scaling policy configuration.static interfaceDescribes a load metric for a predictive scaling policy.static interfaceRepresents a metric pair for a predictive scaling policy.static interfaceDescribes a scaling metric for a predictive scaling policy.static interfaceStepAdjustmentspecifies a step adjustment for theStepAdjustmentsproperty of the AWS::ApplicationAutoScaling::ScalingPolicy StepScalingPolicyConfiguration property type.static interfaceStepScalingPolicyConfigurationis a property of the AWS::ApplicationAutoScaling::ScalingPolicy resource that specifies a step scaling policy configuration for Application Auto Scaling.static interfaceThe metric data to return.static interfaceTargetTrackingMetricDimensionspecifies a name/value pair that is part of the identity of a CloudWatch metric for theDimensionsproperty of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetric property type.static interfaceRepresents a specific metric for a target tracking scaling policy for Application Auto Scaling.static interfaceThis structure defines the CloudWatch metric to return, along with the statistic and unit.static interfaceTargetTrackingScalingPolicyConfigurationis a property of the AWS::ApplicationAutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Application Auto Scaling.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.applicationautoscaling.IScalingPolicyRef
IScalingPolicyRef.Jsii$Default, IScalingPolicyRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnScalingPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnScalingPolicy(software.amazon.jsii.JsiiObjectRef objRef) CfnScalingPolicy(software.constructs.Construct scope, String id, CfnScalingPolicyProps props) -
Method Summary
Modifier and TypeMethodDescriptionReturns the ARN of a scaling policy.The name of the scaling policy.The scaling policy type.The predictive scaling policy configuration.The identifier of the resource associated with the scaling policy.The scalable dimension.A reference to a ScalingPolicy resource.The CloudFormation-generated ID of an Application Auto Scaling scalable target.The namespace of the AWS service that provides the resource, or acustom-resource.A step scaling policy.A target tracking scaling policy.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetPolicyName(String value) The name of the scaling policy.voidsetPolicyType(String value) The scaling policy type.voidThe predictive scaling policy configuration.voidsetPredictiveScalingPolicyConfiguration(CfnScalingPolicy.PredictiveScalingPolicyConfigurationProperty value) The predictive scaling policy configuration.voidsetResourceId(String value) The identifier of the resource associated with the scaling policy.voidsetScalableDimension(String value) The scalable dimension.voidsetScalingTargetId(String value) The CloudFormation-generated ID of an Application Auto Scaling scalable target.voidsetServiceNamespace(String value) The namespace of the AWS service that provides the resource, or acustom-resource.voidA step scaling policy.voidA step scaling policy.voidA target tracking scaling policy.voidsetTargetTrackingScalingPolicyConfiguration(CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty value) A target tracking scaling policy.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnScalingPolicy
protected CfnScalingPolicy(software.amazon.jsii.JsiiObjectRef objRef) -
CfnScalingPolicy
protected CfnScalingPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnScalingPolicy
@Stability(Stable) public CfnScalingPolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnScalingPolicyProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
Returns the ARN of a scaling policy. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getScalingPolicyRef
A reference to a ScalingPolicy resource.- Specified by:
getScalingPolicyRefin interfaceIScalingPolicyRef
-
getPolicyName
The name of the scaling policy. -
setPolicyName
The name of the scaling policy. -
getPolicyType
The scaling policy type. -
setPolicyType
The scaling policy type. -
getPredictiveScalingPolicyConfiguration
The predictive scaling policy configuration. -
setPredictiveScalingPolicyConfiguration
The predictive scaling policy configuration. -
setPredictiveScalingPolicyConfiguration
@Stability(Stable) public void setPredictiveScalingPolicyConfiguration(@Nullable CfnScalingPolicy.PredictiveScalingPolicyConfigurationProperty value) The predictive scaling policy configuration. -
getResourceId
The identifier of the resource associated with the scaling policy. -
setResourceId
The identifier of the resource associated with the scaling policy. -
getScalableDimension
The scalable dimension.This string consists of the service namespace, resource type, and scaling property.
-
setScalableDimension
The scalable dimension.This string consists of the service namespace, resource type, and scaling property.
-
getScalingTargetId
The CloudFormation-generated ID of an Application Auto Scaling scalable target. -
setScalingTargetId
The CloudFormation-generated ID of an Application Auto Scaling scalable target. -
getServiceNamespace
The namespace of the AWS service that provides the resource, or acustom-resource. -
setServiceNamespace
The namespace of the AWS service that provides the resource, or acustom-resource. -
getStepScalingPolicyConfiguration
A step scaling policy. -
setStepScalingPolicyConfiguration
A step scaling policy. -
setStepScalingPolicyConfiguration
@Stability(Stable) public void setStepScalingPolicyConfiguration(@Nullable CfnScalingPolicy.StepScalingPolicyConfigurationProperty value) A step scaling policy. -
getTargetTrackingScalingPolicyConfiguration
A target tracking scaling policy. -
setTargetTrackingScalingPolicyConfiguration
@Stability(Stable) public void setTargetTrackingScalingPolicyConfiguration(@Nullable IResolvable value) A target tracking scaling policy. -
setTargetTrackingScalingPolicyConfiguration
@Stability(Stable) public void setTargetTrackingScalingPolicyConfiguration(@Nullable CfnScalingPolicy.TargetTrackingScalingPolicyConfigurationProperty value) A target tracking scaling policy.
-