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 Risposta
0
Risposta accettata

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
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande