- Newest
- Most votes
- Most comments
Please take a look at https://github.com/aws/amazon-ecs-cli
It mentions the following
**ECS now offers two different launch types for tasks and services: EC2 and FARGATE. With the FARGATE launch type, customers no longer have to manage their own container-instances.
In the ECS-CLI, you can specify either launch type when you bring up a cluster using the --launch-type flag (see: Creating an ECS Cluster). You can also configure your cluster to use a particular launch type with the --default-launch-type flag (see: Cluster Configurations).
You can also specify which launch type to use for a task or service in compose up or compose service up, regardless of which launch type is configured for your cluster (see: Starting/Running Tasks).**
I referred the documentation [1] to check whether we can change the value of "LAUNCH TYPE" to use "capacity provider strategy” while deploying a service. According to the doc[1] by using --default-launch-type to your cluster configuration we can set the launch type to EC2 or FARGATE. But there is no mention of using "capacity provider strategy”.
I went ahead and checked the similar use case AWS Command Line Interface (AWS CLI). The AWS Command Line Interface (AWS CLI) is a unified client for AWS services that provides commands for all public API operations. These commands are lower level than those provided by the Amazon ECS CLI. Using the AWS CLI commands we can configure the “--capacity-provider-strategy” attribute while creating the cluster [2].
The details of a capacity provider strategy. A capacity provider strategy can be set when using the RunTask or CreateCluster APIs or as the default capacity provider strategy for a cluster with the CreateCluster API. Only capacity providers that are already associated with a cluster and have an ACTIVE or UPDATING status can be used in a capacity provider strategy. The PutClusterCapacityProviders API is used to associate a capacity provider with a cluster. If specifying a capacity provider that uses an Auto Scaling group, the capacity provider must already be created. New Auto Scaling group capacity providers can be created with the CreateCapacityProvider API operation.
You can check more details details related to this in the documentation[2].
Reference: [1] https://github.com/aws/amazon-ecs-cli#amazon-ecs-cli-commands [2] https://docs.aws.amazon.com/cli/latest/reference/ecs/create-service.html [3] https://docs.aws.amazon.com/cli/latest/reference/ecs/update-service.html [4] https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ecs/put-cluster-capacity-providers.html
Relevant content
- asked 9 months ago
- Accepted Answerasked 7 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 9 months ago