VPC and Networking Setup#
As we dive into ECS (Elastic Container Service), I want to re-emphasize that having your networking set up correctly is critical. Luckily, we’ve already done it! Just know that it will be important that it’s all still set up.
For ECS to work properly, we need:
- A VPC with CIDR
10.0.0.0/22(ourpatientpingVPC) - Two public subnets (
patientping-public-aandpatientping-public-b) - An Internet Gateway attached to the VPC (
patientping-igw) - A route table that sends
0.0.0.0/0to the Internet Gateway, associated with both public subnets (patientping-public-rt)
We’ll run our Fargate tasks and the load balancer in these public subnets. Tasks get outbound internet access (for example, to pull images from ECR) through the Internet Gateway, so we don’t need a NAT Gateway for this course. (In production, you’d often use private subnets and a NAT Gateway or VPC endpoints for stronger isolation.)