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

An ECS service deployment is stuck, tasks start and stop repeatedly. How do you debug?

IntermediateScenarioECS, EKS, Lambda and ECR
Answer

Situation read → The task fails health checks or crashes.

What I'd do →

  1. aws ecs describe-services and read the events
  2. aws ecs describe-tasks --tasks <arn> for stoppedReason and exit code
  3. Check CloudWatch logs of the container
  4. Verify the health check path and grace period healthCheckGracePeriodSeconds
  5. Enable the deployment circuit breaker with rollback

Why → The stopped reason usually names OOM (exit 137) or image pull errors directly.

Interview tip → Exit code 137 equals OOM kill.

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

More on ECS, EKS, Lambda and ECR