Class CfnScalingPlan

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.794Z") @Stability(Stable) public class CfnScalingPlan extends CfnResource implements IInspectable
A CloudFormation AWS::AutoScalingPlans::ScalingPlan.

The AWS::AutoScalingPlans::ScalingPlan resource defines an AWS Auto Scaling scaling plan. A scaling plan is used to scale application resources to size them appropriately to ensure that enough resource is available in the application at peak times and to reduce allocated resource during periods of low utilization. The following resources can be added to a scaling plan:

  • Amazon EC2 Auto Scaling groups
  • Amazon EC2 Spot Fleet requests
  • Amazon ECS services
  • Amazon DynamoDB tables and global secondary indexes
  • Amazon Aurora Replicas

For more information, see the AWS 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.autoscalingplans.*;
 CfnScalingPlan cfnScalingPlan = CfnScalingPlan.Builder.create(this, "MyCfnScalingPlan")
         .applicationSource(ApplicationSourceProperty.builder()
                 .cloudFormationStackArn("cloudFormationStackArn")
                 .tagFilters(List.of(TagFilterProperty.builder()
                         .key("key")
                         // the properties below are optional
                         .values(List.of("values"))
                         .build()))
                 .build())
         .scalingInstructions(List.of(ScalingInstructionProperty.builder()
                 .maxCapacity(123)
                 .minCapacity(123)
                 .resourceId("resourceId")
                 .scalableDimension("scalableDimension")
                 .serviceNamespace("serviceNamespace")
                 .targetTrackingConfigurations(List.of(TargetTrackingConfigurationProperty.builder()
                         .targetValue(123)
                         // the properties below are optional
                         .customizedScalingMetricSpecification(CustomizedScalingMetricSpecificationProperty.builder()
                                 .metricName("metricName")
                                 .namespace("namespace")
                                 .statistic("statistic")
                                 // the properties below are optional
                                 .dimensions(List.of(MetricDimensionProperty.builder()
                                         .name("name")
                                         .value("value")
                                         .build()))
                                 .unit("unit")
                                 .build())
                         .disableScaleIn(false)
                         .estimatedInstanceWarmup(123)
                         .predefinedScalingMetricSpecification(PredefinedScalingMetricSpecificationProperty.builder()
                                 .predefinedScalingMetricType("predefinedScalingMetricType")
                                 // the properties below are optional
                                 .resourceLabel("resourceLabel")
                                 .build())
                         .scaleInCooldown(123)
                         .scaleOutCooldown(123)
                         .build()))
                 // the properties below are optional
                 .customizedLoadMetricSpecification(CustomizedLoadMetricSpecificationProperty.builder()
                         .metricName("metricName")
                         .namespace("namespace")
                         .statistic("statistic")
                         // the properties below are optional
                         .dimensions(List.of(MetricDimensionProperty.builder()
                                 .name("name")
                                 .value("value")
                                 .build()))
                         .unit("unit")
                         .build())
                 .disableDynamicScaling(false)
                 .predefinedLoadMetricSpecification(PredefinedLoadMetricSpecificationProperty.builder()
                         .predefinedLoadMetricType("predefinedLoadMetricType")
                         // the properties below are optional
                         .resourceLabel("resourceLabel")
                         .build())
                 .predictiveScalingMaxCapacityBehavior("predictiveScalingMaxCapacityBehavior")
                 .predictiveScalingMaxCapacityBuffer(123)
                 .predictiveScalingMode("predictiveScalingMode")
                 .scalingPolicyUpdateBehavior("scalingPolicyUpdateBehavior")
                 .scheduledActionBufferTime(123)
                 .build()))
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnScalingPlan

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

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

      @Stability(Stable) public CfnScalingPlan(@NotNull Construct scope, @NotNull String id, @NotNull CfnScalingPlanProps props)
      Create a new AWS::AutoScalingPlans::ScalingPlan.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrScalingPlanName

      @Stability(Stable) @NotNull public String getAttrScalingPlanName()
    • getAttrScalingPlanVersion

      @Stability(Stable) @NotNull public String getAttrScalingPlanVersion()
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getApplicationSource

      @Stability(Stable) @NotNull public Object getApplicationSource()
      A CloudFormation stack or a set of tags.

      You can create one scaling plan per application source. The ApplicationSource property must be present to ensure interoperability with the AWS Auto Scaling console.

    • setApplicationSource

      @Stability(Stable) public void setApplicationSource(@NotNull CfnScalingPlan.ApplicationSourceProperty value)
      A CloudFormation stack or a set of tags.

      You can create one scaling plan per application source. The ApplicationSource property must be present to ensure interoperability with the AWS Auto Scaling console.

    • setApplicationSource

      @Stability(Stable) public void setApplicationSource(@NotNull IResolvable value)
      A CloudFormation stack or a set of tags.

      You can create one scaling plan per application source. The ApplicationSource property must be present to ensure interoperability with the AWS Auto Scaling console.

    • getScalingInstructions

      @Stability(Stable) @NotNull public Object getScalingInstructions()
      The scaling instructions.
    • setScalingInstructions

      @Stability(Stable) public void setScalingInstructions(@NotNull IResolvable value)
      The scaling instructions.
    • setScalingInstructions

      @Stability(Stable) public void setScalingInstructions(@NotNull List<Object> value)
      The scaling instructions.