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:

  1. A VPC with CIDR 10.0.0.0/22 (our patientping VPC)
  2. Two public subnets (patientping-public-a and patientping-public-b)
  3. An Internet Gateway attached to the VPC (patientping-igw)
  4. A route table that sends 0.0.0.0/0 to 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.)