Skip to content

Choose a path

Shared setup is done. From here the walkthrough splits. Each path creates its own cluster and gateway in the same VPC. Run one path or both — they do not share a gateway.

Shared setupVPC · IAM roles
EC2 path

ecs-gw-lab-ec2 cluster + gateway

Fargate path

ecs-gw-lab-fargate cluster + gateway

Shared teardownwhen both are done

For the gateway it makes no difference — same connector, same shared ALB, same managed hostnames. The only question is who runs the host.

Fargate default

  • No servers to manage — AWS runs the host
  • Bursty or variable load; scales to zero between tasks
  • Least operational overhead
  • Standard web services and APIs
Choose EC2 when
  • Steady, high utilization — often cheaper (Savings Plans, Spot, Graviton)
  • You need GPUs or specific instance types Fargate doesn’t offer
  • Host-level control — privileged containers, kernel params, custom runtimes
  • Bin-packing many small tasks onto fewer hosts, or an existing fleet

After you finish a path’s own teardown page, delete the shared VPC and IAM roles only when you are done with both paths (see the teardown page you used — it ends with shared cleanup).