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

An image push to ECR fails with "denied: Your authorization token has expired". What do you do?

IntermediateScenarioECS, EKS, Lambda and ECR
Answer

Situation read → ECR tokens last 12 hours.

What I'd do →

  1. Re-authenticate: aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 111111111111.dkr.ecr.eu-west-1.amazonaws.com
  2. In CI, run login each job
  3. Use credential helper docker-credential-ecr-login

Why → Tokens are short-lived by design.

Interview tip → Credential helper avoids manual login.

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

More on ECS, EKS, Lambda and ECR