Interview Prep/AWS/ECS, EKS, Lambda and ECR

An ECS task cannot pull its image from ECR in a private subnet: "CannotPullContainerError". Why?

IntermediateScenarioECS, EKS, Lambda and ECR
Answer

Situation read → No network path to ECR or missing execution role permission.

What I'd do →

  1. Add interface endpoints ecr.api, ecr.dkr and an S3 gateway endpoint for layers
  2. Or provide NAT
  3. Execution role needs AmazonECSTaskExecutionRolePolicy
  4. Check SG allows 443 to the endpoints
  5. Retry the service

Why → Layers are stored in S3, which most people forget when building endpoints.

Interview tip → S3 gateway endpoint is part of the set.

aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on ECS, EKS, Lambda and ECR