AWS Certified Cloud Practitioner (CLF-C02)Cloud Technology and ServicesEasy

A developer wants to run short pieces of code in response to file uploads to S3, without provisioning or managing any servers, and only pay for the compute time actually consumed. Which AWS service best fits this requirement?

  1. AAWS Elastic Beanstalk
  2. BAWS Lambda
  3. CAmazon ECS
  4. DAmazon EC2
Show answer & explanation

Correct answer: B. AWS Lambda

AWS Lambda is a serverless compute service that runs code in response to events (such as an S3 upload) and automatically manages the underlying infrastructure, charging only for the compute time consumed during execution.

Why the other options are wrong

  • A. Elastic Beanstalk manages application deployment but still runs on provisioned instances.
  • C. ECS requires managing container clusters or tasks, not purely event-driven functions.
  • D. EC2 requires you to provision and manage servers, which is not serverless.

AWS Lambda

A serverless compute service that runs code in response to triggers/events without requiring server provisioning or management.

  • Pay only for compute time used (per millisecond)
  • Automatically scales with incoming events
  • Commonly triggered by S3, API Gateway, DynamoDB Streams, etc.

Memory trick: Lambda: 'run the code, skip the server.'

More Cloud Technology and Services questions