Amazon ECS and Fargate
AWS runs your containers; with Fargate you never see the servers at all.
Amazon ECS (Elastic container Service) is the AWS service that runs containers for you. You write a task definition: which container image to use, how much CPU and memory it needs, which ports it opens, which environment variables it gets. Then you create a service: 'keep three copies of this task running behind this load balancer', and ECS makes sure three are always alive, replacing any that die.
Where do those containers physically run? Two options. With the EC2 launch type you keep a fleet of Amazon EC2 instances and ECS places tasks on them; you patch and size the machines. With Fargate there is no machine to manage: you say 'this task needs 1 vCPU and 2 GB', AWS finds the capacity, starts the container and bills you per second while it runs.
Example: a Python API packaged as a Docker image and pushed to Amazon ECR, the AWS image registry. An ECS service on Fargate runs two copies in private subnets of a VPC with a load balancer in front; autoscaling adds copies when CPU stays above 70%. Shipping a new version means pushing a new image tag and letting ECS roll it out copy by copy.
ECS is the simpler, AWS-native way to run containers. Amazon EKS is the choice when a team already works with Kubernetes and wants to keep that toolset.
Keep in mind
- A task definition is the recipe; a service keeps N copies of it running and healthy.
- Fargate removes servers entirely: you pay per vCPU and GB for the seconds a task runs.
- Images usually live in Amazon ECR, the AWS container registry.
- ECS plugs into IAM, load balancers and CloudWatch without extra setup.