
Answer-first summary for fast verification
Answer: aws ecs create-service --service-name ecs-simple-service --task-definition ecs-demo --desired-count 10
Overall explanation Correct option: aws ecs create-service --service-name ecs-simple-service --task-definition ecs-demo --desired-count 10 To create a new service you would use this command which creates a service in your default region called ecs-simple-service. The service uses the ecs-demo task definition and it maintains 10 instantiations of that task. Incorrect options: aws ecr create-service --service-name ecs-simple-service --task-definition ecs-demo --desired-count 10 - This command is referencing a different service called Amazon Elastic Container Registry (ECR) which's is a fully-managed Docker container registry docker-compose create ecs-simple-service - This is a docker command to create containers for a service. aws ecs run-task --cluster default --task-definition ecs-demo - This is a valid command but used for starting a new task using a specified task definition.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your company is transitioning to using Amazon Elastic Container Service (ECS) for deploying its applications, and there is a need to automate this process. You are tasked with using the AWS Command Line Interface (CLI) to ensure that a service is created within the default ECS cluster. This service must maintain a minimum of ten running instances of a specified task definition.
Which of the following AWS CLI commands will achieve this requirement?
A
aws ecr create-service --service-name ecs-simple-service --task-definition ecs-demo --desired-count 10
B
aws ecs create-service --service-name ecs-simple-service --task-definition ecs-demo --desired-count 10
C
docker-compose create ecs-simple-service
D
aws ecs run-task --cluster default --task-definition ecs-demo
No comments yet.