Containers on AWS
Amazon ECR — managed Docker registry. Backed by S3. IAM controls access. Supports vulnerability scanning.
Amazon ECS — EC2 Launch Type: You provision/maintain the EC2 instances. EC2 must run ECS Agent to register in the cluster.
Amazon ECS — Fargate Launch Type: Serverless. No instances to manage. Just create task definitions; AWS runs them based on CPU/RAM needed.
ECS IAM Roles:
- EC2 Instance Profile (EC2 launch type only) — used by ECS agent to call ECS API, CloudWatch, ECR, Secrets Manager.
- ECS Task Role — allows each task to call specific AWS services. Defined in task definition.
ECS Auto Scaling: ECS Service Auto Scaling (task level). Can use Target Tracking, Step, or Scheduled. Fargate auto scaling is simpler. EC2 Cluster Capacity Provider pairs with an ASG to scale EC2 instances automatically.
ECS + EFS: Mount EFS file systems for persistent shared storage. Works for both EC2 and Fargate launch types. Fargate + EFS = serverless persistent storage. Note: ECS: S3 cannot be mounted as a file system.
ECS Load Balancers: ALB preferred (HTTP, path routing). NLB for high throughput. Classic LB not recommended (no Fargate support).
Amazon EKS: Managed Kubernetes. Use when already using Kubernetes on-premises or another cloud. Node types: Managed Node Groups (AWS manages ASG), Self-Managed Nodes, or Fargate (serverless).
AWS App Runner: Fully managed service to deploy containerized or source-code-based web apps. No infrastructure knowledge required. Auto-scaling, HTTPS, load balancing built-in.
