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 →
- 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 - In CI, run login each job
- Use credential helper
docker-credential-ecr-login
Why → Tokens are short-lived by design.
Interview tip → Credential helper avoids manual login.
More on ECS, EKS, Lambda and ECR
ECS on Fargate or on EC2: how do you choose?BeginnerDeploy a containerized API on ECS behind an ALB. What are the building blocks?BeginnerAn ECS service deployment is stuck, tasks start and stop repeatedly. How do you debug?IntermediateRoll out a new ECS service version with canary and automatic rollback.IntermediateEKS pods need access to S3 without node-level permissions. How?IntermediateUpgrade an EKS cluster from 1.31 to 1.33 safely.Intermediate