Skip to content

How to Scale Out an AWS ECS Service

When you create the Amazon ECS service, it includes three Amazon ECS task replicas. You can see this by using the describe-services command, which returns three. Use the update-service command to scale the service to five tasks. Re-run the describe-services command to see the updated five.

Step 1 – Query the desired count

aws ecs describe-services \ --cluster fargate-getting-started \ --services nginx-service \ --query 'services[0].desiredCount'
Code language: Bash (bash)

Output: 3

Step 2 – Set the new desired count

aws ecs update-service \ --cluster fargate-getting-started \ --service nginx-service \ --desired-count 5
Code language: Bash (bash)

This will now update the service to have a desired count of 5.

Step 3 – Query the updated desired count

aws ecs describe-services \ --cluster fargate-getting-started \ --services nginx-service \ --query 'services[0].desiredCount'
Code language: Bash (bash)

Output: 5

See also  How to Order by File Size using the du command in Linux
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x