Creating an Auto Scaling group capacity provider using the classic console
The new experience is now the default in the Amazon ECS console. For more information, see Creating a capacity provider using the console. |
A capacity provider is used in association with a cluster to determine the infrastructure that a task runs on. When creating a capacity provider, you specify the following details:
-
An Auto Scaling group Amazon Resource Name (ARN)
-
Whether or not to turn on managed scaling. When managed scaling is enabled, Amazon ECS manages the scale-in and scale-out actions of the Auto Scaling group through the use of AWS Auto Scaling scaling policies. When managed scaling is turned off, you manage your Auto Scaling groups yourself.
-
Whether or not to turn on managed termination protection. When managed termination protection is enabled, Amazon ECS prevents Amazon EC2 instances that contain tasks and that are in an Auto Scaling group from being terminated during a scale-in action. Managed termination protection can only be enabled if the Auto Scaling group also has instance protection from scale in enabled.
Use the following steps to create a new capacity provider for an existing Amazon ECS cluster.
To create an Auto Scaling group capacity provider (classic AWS Management Console)
Open the Amazon ECS classic console at https://console.aws.amazon.com/ecs/
. -
From the navigation bar, select the Region your cluster exists in.
-
In the navigation pane, choose Clusters.
-
On the Clusters page, select your cluster.
-
On the Cluster :
name
page, choose Capacity Providers, and then choose Create. -
For Capacity provider name, enter a capacity provider name.
-
For Auto Scaling group, select the Auto Scaling group to associate with the capacity provider. The Auto Scaling group must already be created.
-
For Managed scaling, choose your managed scaling option. When managed scaling is enabled, Amazon ECS manages the scale-in and scale-out actions of the Auto Scaling group through the use of AWS Auto Scaling scaling policies. When managed scaling is turned off, you manage your Auto Scaling groups yourself.
-
For Target capacity %, if managed scaling is enabled, specify an integer between
1
and100
. The target capacity value is used as the target value for the CloudWatch metric used in the Amazon ECS-managed target tracking scaling policy. This target capacity value is matched on a best effort basis. For example, a value of100
will result in the Amazon EC2 instances in your Auto Scaling group being completely utilized and any instances not running any tasks will be scaled in, but this behavior is not guaranteed at all times. -
For Managed termination protection, choose your managed termination protection option. When managed termination protection is enabled, Amazon ECS prevents Amazon EC2 instances that contain tasks and that are in an Auto Scaling group from being terminated during a scale-in action. Managed termination protection can only be enabled if the Auto Scaling group also has instance protection from scale in enabled and if managed scaling is enabled. Managed termination protection is only supported on standalone tasks or tasks in a service using the replica scheduling strategy. For tasks in a service using the daemon scheduling strategy, the instances are not protected.
-
Choose Create to complete the capacity provider creation.
To create an Auto Scaling group capacity provider (AWS CLI)
-
Use the following command to create a new capacity provider.
-
create-capacity-provider (AWS CLI)
aws ecs create-capacity-provider \ --name
CapacityProviderName
\ --auto-scaling-group-provider autoScalingGroupArn="AutoScalingGroupARN
",managedScaling=\{status='ENABLED|DISABLED
',targetCapacity=integer
,minimumScalingStepSize=integer
,maximumScalingStepSize=integer
\},managedTerminationProtection="ENABLED|DISABLED
" \ --regionus-east-2
If you prefer to use a JSON input file with the
create-capacity-provider
command, use the following command to generate a CLI skeleton.aws ecs create-capacity-provider --generate-cli-skeleton
-