Table Of Contents

Feedback

User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . autoscaling-plans ]

create-scaling-plan

Description

Creates a scaling plan.

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.

Synopsis

  create-scaling-plan
--scaling-plan-name <value>
--application-source <value>
--scaling-instructions <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]

Options

--scaling-plan-name (string)

The name of the scaling plan. Names cannot contain vertical bars, colons, or forward slashes.

--application-source (structure)

A CloudFormation stack or set of tags. You can create one scaling plan per application source.

JSON Syntax:

{
  "CloudFormationStackARN": "string",
  "TagFilters": [
    {
      "Key": "string",
      "Values": ["string", ...]
    }
    ...
  ]
}

--scaling-instructions (list)

The scaling instructions.

JSON Syntax:

[
  {
    "ServiceNamespace": "autoscaling"|"ecs"|"ec2"|"rds"|"dynamodb",
    "ResourceId": "string",
    "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity"|"ecs:service:DesiredCount"|"ec2:spot-fleet-request:TargetCapacity"|"rds:cluster:ReadReplicaCount"|"dynamodb:table:ReadCapacityUnits"|"dynamodb:table:WriteCapacityUnits"|"dynamodb:index:ReadCapacityUnits"|"dynamodb:index:WriteCapacityUnits",
    "MinCapacity": integer,
    "MaxCapacity": integer,
    "TargetTrackingConfigurations": [
      {
        "PredefinedScalingMetricSpecification": {
          "PredefinedScalingMetricType": "ASGAverageCPUUtilization"|"ASGAverageNetworkIn"|"ASGAverageNetworkOut"|"DynamoDBReadCapacityUtilization"|"DynamoDBWriteCapacityUtilization"|"ECSServiceAverageCPUUtilization"|"ECSServiceAverageMemoryUtilization"|"ALBRequestCountPerTarget"|"RDSReaderAverageCPUUtilization"|"RDSReaderAverageDatabaseConnections"|"EC2SpotFleetRequestAverageCPUUtilization"|"EC2SpotFleetRequestAverageNetworkIn"|"EC2SpotFleetRequestAverageNetworkOut",
          "ResourceLabel": "string"
        },
        "CustomizedScalingMetricSpecification": {
          "MetricName": "string",
          "Namespace": "string",
          "Dimensions": [
            {
              "Name": "string",
              "Value": "string"
            }
            ...
          ],
          "Statistic": "Average"|"Minimum"|"Maximum"|"SampleCount"|"Sum",
          "Unit": "string"
        },
        "TargetValue": double,
        "DisableScaleIn": true|false,
        "ScaleOutCooldown": integer,
        "ScaleInCooldown": integer,
        "EstimatedInstanceWarmup": integer
      }
      ...
    ],
    "PredefinedLoadMetricSpecification": {
      "PredefinedLoadMetricType": "ASGTotalCPUUtilization"|"ASGTotalNetworkIn"|"ASGTotalNetworkOut"|"ALBTargetGroupRequestCount",
      "ResourceLabel": "string"
    },
    "CustomizedLoadMetricSpecification": {
      "MetricName": "string",
      "Namespace": "string",
      "Dimensions": [
        {
          "Name": "string",
          "Value": "string"
        }
        ...
      ],
      "Statistic": "Average"|"Minimum"|"Maximum"|"SampleCount"|"Sum",
      "Unit": "string"
    },
    "ScheduledActionBufferTime": integer,
    "PredictiveScalingMaxCapacityBehavior": "SetForecastCapacityToMaxCapacity"|"SetMaxCapacityToForecastCapacity"|"SetMaxCapacityAboveForecastCapacity",
    "PredictiveScalingMaxCapacityBuffer": integer,
    "PredictiveScalingMode": "ForecastAndScale"|"ForecastOnly",
    "ScalingPolicyUpdateBehavior": "KeepExternalPolicies"|"ReplaceExternalPolicies",
    "DisableDynamicScaling": true|false
  }
  ...
]

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.

Examples

To create a scaling plan

The following create-scaling-plan example creates a scaling plan named my-scaling-plan using an already-created JSON file (named config.json). The structure of the scaling plan includes a scaling instruction for an Auto Scaling group named my-asg. It specifies the TagFilters property as the application source and enables predictive scaling and dynamic scaling.

aws autoscaling-plans create-scaling-plan \
    --scaling-plan-name my-scaling-plan \
    --cli-input-json file://~/config.json

Contents of config.json file:

{
    "ApplicationSource": {
        "TagFilters": [
            {
                "Key": "purpose",
                "Values": [
                    "my-application"
                ]
            }
        ]
    },
    "ScalingInstructions": [
        {
            "ServiceNamespace": "autoscaling",
            "ResourceId": "autoScalingGroup/my-asg",
            "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity",
            "ScheduledActionBufferTime": 300,
            "PredictiveScalingMaxCapacityBehavior": "SetForecastCapacityToMaxCapacity",
            "PredictiveScalingMode": "ForecastAndScale",
            "PredefinedLoadMetricSpecification": {
                "PredefinedLoadMetricType": "ASGTotalCPUUtilization"
            },
            "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies",
            "MinCapacity": 1,
            "MaxCapacity": 4,
            "TargetTrackingConfigurations": [
                {
                    "PredefinedScalingMetricSpecification": {
                        "PredefinedScalingMetricType": "ASGAverageCPUUtilization"
                    },
                    "TargetValue": 50
                }
            ]
        }
    ]
}

Output:

{
"ScalingPlanVersion": 1
}

For more information, see the AWS Auto Scaling User Guide.

Output

ScalingPlanVersion -> (long)

The version number of the scaling plan. This value is always 1.

Currently, you cannot specify multiple scaling plan versions.