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 Amazon EC2 Auto Scaling group capacity providers.
Associate the capacity provider with the cluster
Use the following steps to associate the capacity provider with the cluster.
-
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 theFARGATE
andFARGATE_SPOT
capacity providers in the request. For more information, seeput-cluster-capacity-providers
in the Amazon CLI Command Reference.aws ecs put-cluster-capacity-providers \ --cluster
ClusterName
\ --capacity-providersCapacityProviderName
FARGATE FARGATE_SPOT \ --default-capacity-provider-strategy capacityProvider=CapacityProvider,weight=1 -
Use the
describe-clusters
command to verify that the association was successful. For more information, seedescribe-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, seeupdate-capacity-provider
in the Amazon CLI Command Reference.aws ecs update-capacity-provider \ --capacity-providers
CapacityProviderName
\ --auto-scaling-group-provider managedScaling=ENABLED