Class CfnScalingPolicyPropsMixin

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.autoscaling.CfnScalingPolicyPropsMixin
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IMixin

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-04-14T18:32:08.904Z") @Stability(Stable) public class CfnScalingPolicyPropsMixin extends Mixin implements software.constructs.IMixin
The AWS::AutoScaling::ScalingPolicy resource specifies an Amazon EC2 Auto Scaling scaling policy so that the Auto Scaling group can scale the number of instances available for your application.

For more information about using scaling policies to scale your Auto Scaling group automatically, see Dynamic scaling and Predictive scaling in the Amazon EC2 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.cfnpropertymixins.services.autoscaling.*;
 import software.amazon.awscdk.*;
 IMergeStrategy mergeStrategy;
 CfnScalingPolicyPropsMixin cfnScalingPolicyPropsMixin = CfnScalingPolicyPropsMixin.Builder.create(CfnScalingPolicyMixinProps.builder()
         .adjustmentType("adjustmentType")
         .autoScalingGroupName("autoScalingGroupName")
         .cooldown("cooldown")
         .estimatedInstanceWarmup(123)
         .metricAggregationType("metricAggregationType")
         .minAdjustmentMagnitude(123)
         .policyType("policyType")
         .predictiveScalingConfiguration(PredictiveScalingConfigurationProperty.builder()
                 .maxCapacityBreachBehavior("maxCapacityBreachBehavior")
                 .maxCapacityBuffer(123)
                 .metricSpecifications(List.of(PredictiveScalingMetricSpecificationProperty.builder()
                         .customizedCapacityMetricSpecification(PredictiveScalingCustomizedCapacityMetricProperty.builder()
                                 .metricDataQueries(List.of(MetricDataQueryProperty.builder()
                                         .expression("expression")
                                         .id("id")
                                         .label("label")
                                         .metricStat(MetricStatProperty.builder()
                                                 .metric(MetricProperty.builder()
                                                         .dimensions(List.of(MetricDimensionProperty.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(MetricDataQueryProperty.builder()
                                         .expression("expression")
                                         .id("id")
                                         .label("label")
                                         .metricStat(MetricStatProperty.builder()
                                                 .metric(MetricProperty.builder()
                                                         .dimensions(List.of(MetricDimensionProperty.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(MetricDataQueryProperty.builder()
                                         .expression("expression")
                                         .id("id")
                                         .label("label")
                                         .metricStat(MetricStatProperty.builder()
                                                 .metric(MetricProperty.builder()
                                                         .dimensions(List.of(MetricDimensionProperty.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")
                                 .resourceLabel("resourceLabel")
                                 .build())
                         .predefinedMetricPairSpecification(PredictiveScalingPredefinedMetricPairProperty.builder()
                                 .predefinedMetricType("predefinedMetricType")
                                 .resourceLabel("resourceLabel")
                                 .build())
                         .predefinedScalingMetricSpecification(PredictiveScalingPredefinedScalingMetricProperty.builder()
                                 .predefinedMetricType("predefinedMetricType")
                                 .resourceLabel("resourceLabel")
                                 .build())
                         .targetValue(123)
                         .build()))
                 .mode("mode")
                 .schedulingBufferTime(123)
                 .build())
         .scalingAdjustment(123)
         .stepAdjustments(List.of(StepAdjustmentProperty.builder()
                 .metricIntervalLowerBound(123)
                 .metricIntervalUpperBound(123)
                 .scalingAdjustment(123)
                 .build()))
         .targetTrackingConfiguration(TargetTrackingConfigurationProperty.builder()
                 .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(MetricProperty.builder()
                                                 .dimensions(List.of(MetricDimensionProperty.builder()
                                                         .name("name")
                                                         .value("value")
                                                         .build()))
                                                 .metricName("metricName")
                                                 .namespace("namespace")
                                                 .build())
                                         .period(123)
                                         .stat("stat")
                                         .unit("unit")
                                         .build())
                                 .period(123)
                                 .returnData(false)
                                 .build()))
                         .namespace("namespace")
                         .period(123)
                         .statistic("statistic")
                         .unit("unit")
                         .build())
                 .disableScaleIn(false)
                 .predefinedMetricSpecification(PredefinedMetricSpecificationProperty.builder()
                         .predefinedMetricType("predefinedMetricType")
                         .resourceLabel("resourceLabel")
                         .build())
                 .targetValue(123)
                 .build())
         .build())
 .strategy(mergeStrategy)
 .build();
 

See Also:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> CFN_PROPERTY_KEYS
  • Constructor Details

    • CfnScalingPolicyPropsMixin

      protected CfnScalingPolicyPropsMixin(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnScalingPolicyPropsMixin

      protected CfnScalingPolicyPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnScalingPolicyPropsMixin

      @Stability(Stable) public CfnScalingPolicyPropsMixin(@NotNull CfnScalingPolicyMixinProps props, @Nullable CfnPropertyMixinOptions options)
      Create a mixin to apply properties to AWS::AutoScaling::ScalingPolicy.

      Parameters:
      props - L1 properties to apply. This parameter is required.
      options - Mixin options.
    • CfnScalingPolicyPropsMixin

      @Stability(Stable) public CfnScalingPolicyPropsMixin(@NotNull CfnScalingPolicyMixinProps props)
      Create a mixin to apply properties to AWS::AutoScaling::ScalingPolicy.

      Parameters:
      props - L1 properties to apply. This parameter is required.
  • Method Details

    • applyTo

      @Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct)
      Apply the mixin properties to the construct.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnScalingPolicyMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()