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
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2025-01-15T21:09:14.157Z")
@Stability(Stable)
public class CfnScalingPolicy
extends CfnResource
implements IInspectable
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
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnScalingPolicy
.static interface
Contains customized metric specification information for a target tracking scaling policy for Application Auto Scaling.static interface
MetricDimension
specifies a name/value pair that is part of the identity of a CloudWatch metric for theDimensions
property of the AWS::ApplicationAutoScaling::ScalingPolicy CustomizedMetricSpecification property type.static interface
Contains predefined metric specification information for a target tracking scaling policy for Application Auto Scaling.static interface
Represents a CloudWatch metric of your choosing for a predictive scaling policy.static interface
The customized load metric specification.static interface
One or more metric data queries to provide data points for a metric specification.static interface
The metric data to return.static interface
Describes the dimension of a metric.static interface
Describes the scaling metric.static interface
This structure specifies the metrics and target utilization settings for a predictive scaling policy.static interface
This structure defines the CloudWatch metric to return, along with the statistic and unit.static interface
Represents a predictive scaling policy configuration.static interface
Describes a load metric for a predictive scaling policy.static interface
Represents a metric pair for a predictive scaling policy.static interface
Describes a scaling metric for a predictive scaling policy.static interface
StepAdjustment
specifies a step adjustment for theStepAdjustments
property of the AWS::ApplicationAutoScaling::ScalingPolicy StepScalingPolicyConfiguration property type.static interface
StepScalingPolicyConfiguration
is a property of the AWS::ApplicationAutoScaling::ScalingPolicy resource that specifies a step scaling policy configuration for Application Auto Scaling.static interface
The metric data to return.static interface
TargetTrackingMetricDimension
specifies a name/value pair that is part of the identity of a CloudWatch metric for theDimensions
property of the AWS::ApplicationAutoScaling::ScalingPolicy TargetTrackingMetric property type.static interface
Represents a specific metric for a target tracking scaling policy for Application Auto Scaling.static interface
This structure defines the CloudWatch metric to return, along with the statistic and unit.static interface
TargetTrackingScalingPolicyConfiguration
is 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.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnScalingPolicy
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnScalingPolicy
(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.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.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setPolicyName
(String value) The name of the scaling policy.void
setPolicyType
(String value) The scaling policy type.void
The predictive scaling policy configuration.void
setPredictiveScalingPolicyConfiguration
(CfnScalingPolicy.PredictiveScalingPolicyConfigurationProperty value) The predictive scaling policy configuration.void
setResourceId
(String value) The identifier of the resource associated with the scaling policy.void
setScalableDimension
(String value) The scalable dimension.void
setScalingTargetId
(String value) The CloudFormation-generated ID of an Application Auto Scaling scalable target.void
setServiceNamespace
(String value) The namespace of the AWS service that provides the resource, or acustom-resource
.void
A step scaling policy.void
A step scaling policy.void
A target tracking scaling policy.void
setTargetTrackingScalingPolicyConfiguration
(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, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:
inspect
in 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:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
Returns the ARN of a scaling policy. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
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.
-