skip to Main Content

Is it possible to scale AWS ECS tasks based on an external parameter?

I have hosted a service on AWS ECS and it is running with 2 ECS tasks. I want to scale-out the tasks based on some count that I get from a different service.

Would it possible for AWS ECS to scale the tasks based on the count that is returned from an external parameter/service?

Where do I have to publish this count to auto scale the containers?

2

Answers


  1. Chosen as BEST ANSWER

    I did some research and found an alternate (Cheaper) solution to custom cloud watch metric.

    In order to publish custom metric, you are going to do a recurring operation to poll the external parameter and send it to AWS.

    Instead, you can use the same recurring operation to poll the parameter and scale-in or out ECS tasks using ECS UpdateService API

    You can set the desired count through updateService request and increase or decrease the count of your tasks based on the external parameter.

    It will save you the cost of putting cloud watch metrics.


  2. Yes, you can do this through Application Auto Scaling for ECS. Specifically you can setup target tracking scaling policy with a custom CloudWatch metric.

    So basically, you would have to create a custom metric based on the data from the external provider.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search