'Limit number the number of concurrent Fargate tasks for a given task definition

I have a given AWS fargate task definition. do_something calls a downstream service that does not support more than 4 concurrent consumers. I must therefore find a way to limit the number of concurrent do_something fargate tasks that run at the same time.

Is there a built-in way to do this? I wasn't able to find it in the documentation.



Solution 1:[1]

In the scaling policy you san set the maximum number of tasks to 4.

Here you can see a picture of the setting. enter image description here

Solution 2:[2]

Had the same problem. Contacted support this was the answer.

Hi there, I understand that you would like to increase your Fargate limit for concurrent tasks, I'm happy to assist! As per Fargate team recommendation, can you try to launch an EC2 instance in your region for a few minutes and then terminate the instance? This process will automatically increase your concurrent task limit, if you are still experiencing issues after this, please let us know so I can contact them back in order to manually increase the limit. Have a nice day ahead!

The solution works for me..

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DominikHelps
Solution 2 André Alberto