Turn on cluster Auto Scaling - Amazon Elastic Container Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Turn on cluster Auto Scaling

You can use the Amazon CLI to turn on cluster Auto Scaling.

Before you begin, create an Auto Scaling group and a capacity provider. For more information, see Creating an Auto Scaling group.

Associate the capacity provider with the cluster

Use the following steps to associate the capacity provider with the cluster.

  1. Use the put-cluster-capacity-providers command to associate one or more capacity providers with the cluster. To add the Amazon Fargate capacity providers, simply include the FARGATE and FARGATE_SPOT capacity providers in the request. For more information, see put-cluster-capacity-providers in the Amazon CLI Command Reference.

    aws ecs put-cluster-capacity-providers \ --cluster ClusterName \ --capacity-providers CapacityProviderName FARGATE FARGATE_SPOT \ --default-capacity-provider-strategy capacityProvider=CapacityProvider,weight=1
  2. Use the describe-clusters command to verify that the association was successful. For more information, see describe-clusters in the Amazon CLI Command Reference.

    aws ecs describe-clusters \ --cluster ClusterName \ --include ATTACHMENTS

Turn on managed scaling for the capacity provider

Use the following steps to turn on managed scaling for the capacity provider.

  • Use the update-capacity-provider command to turn on managed auto scaling for the capacity provider. For more information, see update-capacity-provider in the Amazon CLI Command Reference.

    aws ecs update-capacity-provider \ --cluster ClusterName \ --capacity-providers CapacityProviderName \ --auto-scaling-group-provider managedScaling=ENABLED