Interview Prep/Python for DevOps/AWS automation with boto3

A Lambda written in Python times out at 15 minutes while processing a big S3 prefix. What are your options?

AdvancedScenarioAWS automation with boto3
Answer

Situation read → Lambda's hard maximum is 15 minutes; the job is too big for a single invocation.

What I'd do →

  1. Fan out: one Lambda lists keys and sends batches to SQS; worker Lambdas process batches concurrently.
  2. Or use Step Functions Distributed Map over the S3 prefix.
  3. Or move to a container job on ECS/Fargate or AWS Batch with no time limit.
  4. Optimize per item: reuse clients created outside the handler, parallelize I/O with threads.

Why → Lambda is designed for short, parallel work; long sequential jobs belong elsewhere.

Interview tip → Mention creating boto3 clients outside the handler so warm invocations reuse connections.

All Python for DevOps questions Roadmap: Python for automation

More on AWS automation with boto3