Score:0

Selecting subnets for a Service in Fargate

sa flag

enter image description here

As we can see in the picture above, I can select as many subnets as I want. Does it mean, the tasks in the service are created across these two subnets?

Suppose I have one task running, in which subnet will it run then? If there are multiple tasks in the service, how are they distributed between these subnets? Is it something handled by Fargate and we shouldn't worry about?

What if I select a public subnet and a private subnet, I'm guessing it would be a mess in that case.

Sorry if these are noob questions, I'm new to AWS.

Score:2
nl flag

No question is noob. I have been working on Fargate since inception and I don't even know the answer to all of your questions! Anyway, what you see there are subnets that are eligible to launch tasks (as part of your service). If you have one task, it will be deployed to one of them (picked randomly). If you have many tasks, we will (best effort) spread them across all those. You would usually either pick either all public subnets or private subnets (depending on your architecture). Assuming the service allows you to pick heterogeneous subnets (which I am not sure about) I'd treat it as a logical configuration error.

Score:2
gp flag
Tim

You are defining the subnets where your Fargate container can run. You can choose any subnets you like, but I would choose public / private based on the workload and whether it needs to access the internet. If it's a web server then you would usually choose public, if it's an application server that just talks to a database choose private.

Once set up Fargate will put the task in whichever subnet it chooses, you have no control, that's the benefit of a managed service.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.