使用 AWS re:Post 即表示您同意 AWS re:Post 使用條款

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 個回答
1
已接受的答案

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
已回答 2 年前
profile picture
專家
已審閱 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南