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

A deployment fails with `ErrImagePull ... manifest unknown` (or ECS `CannotPullContainerError: ... not found`) for an image that used to work.

BeginnerTroubleshootingECS, EKS, ECR and Lambda
Answer

Likely causes → The tag does not exist in that repository or Region. A typo, a pipeline that never pushed, or an ECR lifecycle policy that expired old tags.

Diagnose →

aws ecr describe-images --repository-name api --image-ids imageTag=1.4.2
aws ecr get-lifecycle-policy --repository-name api
aws ecr describe-images --repository-name api --query 'sort_by(imageDetails,&imagePushedAt)[-5:].imageTags'

Fix →

  1. Push the missing tag again, or deploy an existing digest
  2. Change the lifecycle policy so it keeps images that are still deployed (for example, keep the last 50, and expire only untagged images after 14 days)

Prevent → Deploy by immutable digest, turn on tag immutability, and make lifecycle rules generous enough for rollbacks.

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

More on ECS, EKS, ECR and Lambda