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

Lambda function times out after 3 seconds calling an external API. What's wrong?

BeginnerScenarioECS, EKS, Lambda and ECR
Answer

Situation read → Default timeout is 3 seconds, or the function is in a VPC without egress.

What I'd do →

  1. Increase timeout: aws lambda update-function-configuration --function-name f --timeout 30
  2. If VPC-attached, ensure NAT or endpoint access
  3. Check logs for the exact duration with REPORT lines
  4. Set client timeouts shorter than the function timeout

Why → VPC-attached Lambdas have no internet unless routed via NAT.

Interview tip → Most "mystery timeouts" are VPC egress.

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

More on ECS, EKS, Lambda and ECR