How to set fargate autoscaling policy with aws ecs create-service command and json file?

0

I am trying to create an ecs fargate service through the 'aws ecs create-service --cli-input-json file://service.json --region us-east-2' command.

I want to set the autoscaling policy with the settings in the service.json file, but it didn't seem to exist in the aws docs (https://docs.aws.amazon.com/ko_kr/AmazonECS/latest/APIReference/API_CreateService.html).

How can I put an autoscaling policy in the service creation using the configuration in the json file through the aws ecs create-service command? If not, is there any way?

1 Answer
0
Accepted Answer

Fargate uses the application-autoscaling command to configure AutoScaling as described in the following document.
https://repost.aws/knowledge-center/ecs-fargate-service-auto-scaling

profile picture
EXPERT
answered a year ago
  • I know how to configure autoscaling with the aws-cli and console. I want to know how to configure autoscaling with a json file using the command "'aws ecs create-service --cli-input-json file://service.json --region us-east-2".

  • AutoScaling cannot be configured with the aws ecs create-service command. Application Auto Scaling and ECS Fargate are two different services to begin with, so it is only natural that they have separate APIs.

    https://docs.aws.amazon.com/AmazonECS/latest/userguide/service-auto-scaling.html

    Automatic scaling is the ability to increase or decrease the desired count of tasks in your Amazon ECS service automatically. Amazon ECS leverages the Application Auto Scaling service to provide this functionality. For more information, see the Application Auto Scaling User Guide.

  • Thank you for a description!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions