AWS ECS VPC subnet

0

Hi Guys, I am planning to attach my ALB with service in ECS cluster with Fargate configuration,. When I created Cluster it asked me to create VPC with default configuration, during creation I saw that it is also attaching IGW too.

Now I don't have any idea if this VPC has public or private subnet when I am on cluster View. Never asked me any option question during creation. Can somebody tell me how can I keep my cluster in private subnet which I already have? Do I have to create VPC during cluster creation or In case I do not create VPC what is happening, I am getting lost in the interface.

I mean if I have an VPC already and ALB in it, and cluster is creating new VPC with its own public and private subnet, how am I supposed to bind my ALB in my VPC to the services in newly created VPC that has cluster which holds my task and services?

Screen should give me better understanding about the structure. Can I create cluster in my existing private subnet or no, what is the best practice for this? any documentation will be very helpful, thanks Thanks

ozy
asked a year ago778 views
3 Answers
0
Accepted Answer

Hi!

So when you create a default vpc its created with the following components, which includes a IGW https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html#default-vpc-components You will have to check in VPC to see what subnets were created on your behalf by going to the VPC console.

If you want to use an existing VPC/Subnet that is private you specify this at cluster creation, by selecting the VPC from the drop down. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create_cluster.html

AWS
answered a year ago
  • Seems like it is more clear in new the Interface, I was using old interface to follow some of youtube videos. Thank you.

0

For setting up an ALB to your tasks, here is step by step process https://docs.aws.amazon.com/AmazonECS/latest/userguide/create-application-load-balancer.html

You have two options utilize the existing ECS cluster and spin up an ALB to attach to that task or recreate cluster in VPC where ALB lives and then attach task. Since you want this to private might be best to delete ECS cluster and spin up in correct VPC then attach task as targets for ALB (ensure your ALB properly setup per above documentation).

AWS
answered a year ago
  • Currently I don't have any cluster, so I need to create one, just would like to make sure it is in the private subnet. Just trying to apply best practice and where to start. I already have ALB and can create target group(IP address) which I can attach my cluster.

0

There are a few components here that may be in focus.

It sounds as though you are using the awsvpc task definition. In this case you must create a vpc, subnet, and security group for the service. This is in AWS documentation here

If you are using task types bridge, host, or none, you can find information about using your configured load balancers here

Hope this helps!

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions