How to set the subnet priority of ecs Fargate task

0

Usually, when setting the ECS fargate service, you need to add one or more subnet for the service. When the service creates a task, is the subnet of the task random? Is there any way for me to set the priority of the subnet for ECS service? For example, the priority of the subnet set to 1a is the highest, followed by 1b, and finally 1c. In this way, 1a is preferred when starting a task, and 1b is selected when starting the same task again.

Thank you for any answer!

1 réponse
0
Réponse acceptée

For using Fargate for a few years now, the short answer is no, you wouldn't be able to dictate which subnet to go to. Although not sure why you'd want to do that.

However, if you used EC2 instances, with ASG, you could I suppose create 1 ASG + Capacity Provider combination, with each ASG using only 1 subnet / only subnets in the same AZ, and set a different weight to each of them. When placing containers it will then follow the weight list.

profile picture
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions