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回答
0
承認された回答

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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ