Skip to content
v2.278.0

CfnScalingPlanProps Struct ​

Properties for defining a CfnScalingPlan.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_autoscalingplans as autoscalingplans } from 'aws-cdk-lib';
const cfnScalingPlanProps: autoscalingplans.CfnScalingPlanProps = {
  applicationSource: {
    cloudFormationStackArn: 'cloudFormationStackArn',
    tagFilters: [{
      key: 'key',

      // the properties below are optional
      values: ['values'],
    }],
  },
  scalingInstructions: [{
    maxCapacity: 123,
    minCapacity: 123,
    resourceId: 'resourceId',
    scalableDimension: 'scalableDimension',
    serviceNamespace: 'serviceNamespace',
    targetTrackingConfigurations: [{
      targetValue: 123,

      // the properties below are optional
      customizedScalingMetricSpecification: {
        metricName: 'metricName',
        namespace: 'namespace',
        statistic: 'statistic',

        // the properties below are optional
        dimensions: [{
          name: 'name',
          value: 'value',
        }],
        unit: 'unit',
      },
      disableScaleIn: false,
      estimatedInstanceWarmup: 123,
      predefinedScalingMetricSpecification: {
        predefinedScalingMetricType: 'predefinedScalingMetricType',

        // the properties below are optional
        resourceLabel: 'resourceLabel',
      },
      scaleInCooldown: 123,
      scaleOutCooldown: 123,
    }],

    // the properties below are optional
    customizedLoadMetricSpecification: {
      metricName: 'metricName',
      namespace: 'namespace',
      statistic: 'statistic',

      // the properties below are optional
      dimensions: [{
        name: 'name',
        value: 'value',
      }],
      unit: 'unit',
    },
    disableDynamicScaling: false,
    predefinedLoadMetricSpecification: {
      predefinedLoadMetricType: 'predefinedLoadMetricType',

      // the properties below are optional
      resourceLabel: 'resourceLabel',
    },
    predictiveScalingMaxCapacityBehavior: 'predictiveScalingMaxCapacityBehavior',
    predictiveScalingMaxCapacityBuffer: 123,
    predictiveScalingMode: 'predictiveScalingMode',
    scalingPolicyUpdateBehavior: 'scalingPolicyUpdateBehavior',
    scheduledActionBufferTime: 123,
  }],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_autoscalingplans as autoscalingplans

cfn_scaling_plan_props = autoscalingplans.CfnScalingPlanProps(
    application_source=autoscalingplans.CfnScalingPlan.ApplicationSourceProperty(
        cloud_formation_stack_arn="cloudFormationStackArn",
        tag_filters=[autoscalingplans.CfnScalingPlan.TagFilterProperty(
            key="key",

            # the properties below are optional
            values=["values"]
        )]
    ),
    scaling_instructions=[autoscalingplans.CfnScalingPlan.ScalingInstructionProperty(
        max_capacity=123,
        min_capacity=123,
        resource_id="resourceId",
        scalable_dimension="scalableDimension",
        service_namespace="serviceNamespace",
        target_tracking_configurations=[autoscalingplans.CfnScalingPlan.TargetTrackingConfigurationProperty(
            target_value=123,

            # the properties below are optional
            customized_scaling_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedScalingMetricSpecificationProperty(
                metric_name="metricName",
                namespace="namespace",
                statistic="statistic",

                # the properties below are optional
                dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
                    name="name",
                    value="value"
                )],
                unit="unit"
            ),
            disable_scale_in=False,
            estimated_instance_warmup=123,
            predefined_scaling_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedScalingMetricSpecificationProperty(
                predefined_scaling_metric_type="predefinedScalingMetricType",

                # the properties below are optional
                resource_label="resourceLabel"
            ),
            scale_in_cooldown=123,
            scale_out_cooldown=123
        )],

        # the properties below are optional
        customized_load_metric_specification=autoscalingplans.CfnScalingPlan.CustomizedLoadMetricSpecificationProperty(
            metric_name="metricName",
            namespace="namespace",
            statistic="statistic",

            # the properties below are optional
            dimensions=[autoscalingplans.CfnScalingPlan.MetricDimensionProperty(
                name="name",
                value="value"
            )],
            unit="unit"
        ),
        disable_dynamic_scaling=False,
        predefined_load_metric_specification=autoscalingplans.CfnScalingPlan.PredefinedLoadMetricSpecificationProperty(
            predefined_load_metric_type="predefinedLoadMetricType",

            # the properties below are optional
            resource_label="resourceLabel"
        ),
        predictive_scaling_max_capacity_behavior="predictiveScalingMaxCapacityBehavior",
        predictive_scaling_max_capacity_buffer=123,
        predictive_scaling_mode="predictiveScalingMode",
        scaling_policy_update_behavior="scalingPolicyUpdateBehavior",
        scheduled_action_buffer_time=123
    )]
)
java
// 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.*;

CfnScalingPlanProps cfnScalingPlanProps = CfnScalingPlanProps.builder()
        .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();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AutoScalingPlans;

var cfnScalingPlanProps = new CfnScalingPlanProps {
    ApplicationSource = new ApplicationSourceProperty {
        CloudFormationStackArn = "cloudFormationStackArn",
        TagFilters = new [] { new TagFilterProperty {
            Key = "key",

            // the properties below are optional
            Values = new [] { "values" }
        } }
    },
    ScalingInstructions = new [] { new ScalingInstructionProperty {
        MaxCapacity = 123,
        MinCapacity = 123,
        ResourceId = "resourceId",
        ScalableDimension = "scalableDimension",
        ServiceNamespace = "serviceNamespace",
        TargetTrackingConfigurations = new [] { new TargetTrackingConfigurationProperty {
            TargetValue = 123,

            // the properties below are optional
            CustomizedScalingMetricSpecification = new CustomizedScalingMetricSpecificationProperty {
                MetricName = "metricName",
                Namespace = "namespace",
                Statistic = "statistic",

                // the properties below are optional
                Dimensions = new [] { new MetricDimensionProperty {
                    Name = "name",
                    Value = "value"
                } },
                Unit = "unit"
            },
            DisableScaleIn = false,
            EstimatedInstanceWarmup = 123,
            PredefinedScalingMetricSpecification = new PredefinedScalingMetricSpecificationProperty {
                PredefinedScalingMetricType = "predefinedScalingMetricType",

                // the properties below are optional
                ResourceLabel = "resourceLabel"
            },
            ScaleInCooldown = 123,
            ScaleOutCooldown = 123
        } },

        // the properties below are optional
        CustomizedLoadMetricSpecification = new CustomizedLoadMetricSpecificationProperty {
            MetricName = "metricName",
            Namespace = "namespace",
            Statistic = "statistic",

            // the properties below are optional
            Dimensions = new [] { new MetricDimensionProperty {
                Name = "name",
                Value = "value"
            } },
            Unit = "unit"
        },
        DisableDynamicScaling = false,
        PredefinedLoadMetricSpecification = new PredefinedLoadMetricSpecificationProperty {
            PredefinedLoadMetricType = "predefinedLoadMetricType",

            // the properties below are optional
            ResourceLabel = "resourceLabel"
        },
        PredictiveScalingMaxCapacityBehavior = "predictiveScalingMaxCapacityBehavior",
        PredictiveScalingMaxCapacityBuffer = 123,
        PredictiveScalingMode = "predictiveScalingMode",
        ScalingPolicyUpdateBehavior = "scalingPolicyUpdateBehavior",
        ScheduledActionBufferTime = 123
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnScalingPlanProps := &CfnScalingPlanProps{
	ApplicationSource: &ApplicationSourceProperty{
		CloudFormationStackArn: jsii.String("cloudFormationStackArn"),
		TagFilters: []interface{}{
			&TagFilterProperty{
				Key: jsii.String("key"),

				// the properties below are optional
				Values: []*string{
					jsii.String("values"),
				},
			},
		},
	},
	ScalingInstructions: []interface{}{
		&ScalingInstructionProperty{
			MaxCapacity: jsii.Number(123),
			MinCapacity: jsii.Number(123),
			ResourceId: jsii.String("resourceId"),
			ScalableDimension: jsii.String("scalableDimension"),
			ServiceNamespace: jsii.String("serviceNamespace"),
			TargetTrackingConfigurations: []interface{}{
				&TargetTrackingConfigurationProperty{
					TargetValue: jsii.Number(123),

					// the properties below are optional
					CustomizedScalingMetricSpecification: &CustomizedScalingMetricSpecificationProperty{
						MetricName: jsii.String("metricName"),
						Namespace: jsii.String("namespace"),
						Statistic: jsii.String("statistic"),

						// the properties below are optional
						Dimensions: []interface{}{
							&MetricDimensionProperty{
								Name: jsii.String("name"),
								Value: jsii.String("value"),
							},
						},
						Unit: jsii.String("unit"),
					},
					DisableScaleIn: jsii.Boolean(false),
					EstimatedInstanceWarmup: jsii.Number(123),
					PredefinedScalingMetricSpecification: &PredefinedScalingMetricSpecificationProperty{
						PredefinedScalingMetricType: jsii.String("predefinedScalingMetricType"),

						// the properties below are optional
						ResourceLabel: jsii.String("resourceLabel"),
					},
					ScaleInCooldown: jsii.Number(123),
					ScaleOutCooldown: jsii.Number(123),
				},
			},

			// the properties below are optional
			CustomizedLoadMetricSpecification: &CustomizedLoadMetricSpecificationProperty{
				MetricName: jsii.String("metricName"),
				Namespace: jsii.String("namespace"),
				Statistic: jsii.String("statistic"),

				// the properties below are optional
				Dimensions: []interface{}{
					&MetricDimensionProperty{
						Name: jsii.String("name"),
						Value: jsii.String("value"),
					},
				},
				Unit: jsii.String("unit"),
			},
			DisableDynamicScaling: jsii.Boolean(false),
			PredefinedLoadMetricSpecification: &PredefinedLoadMetricSpecificationProperty{
				PredefinedLoadMetricType: jsii.String("predefinedLoadMetricType"),

				// the properties below are optional
				ResourceLabel: jsii.String("resourceLabel"),
			},
			PredictiveScalingMaxCapacityBehavior: jsii.String("predictiveScalingMaxCapacityBehavior"),
			PredictiveScalingMaxCapacityBuffer: jsii.Number(123),
			PredictiveScalingMode: jsii.String("predictiveScalingMode"),
			ScalingPolicyUpdateBehavior: jsii.String("scalingPolicyUpdateBehavior"),
			ScheduledActionBufferTime: jsii.Number(123),
		},
	},
}

Properties ​

applicationSourceIResolvable | CfnScalingPlan.ApplicationSourcePropertyapplication_sourcetyping.Union[IResolvable, ApplicationSourceProperty]applicationSourceIResolvableApplicationSourceIResolvableApplicationSourceinterface{} required #
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.

scalingInstructionsIResolvable | IResolvable | CfnScalingPlan.ScalingInstructionProperty[]scaling_instructionstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ScalingInstructionProperty]]]scalingInstructionsIResolvableScalingInstructionsIResolvableScalingInstructionsinterface{} required #
The scaling instructions.