CLF-C02 Cloud Technology and Services Practice Question
A company wants to run code that automatically resizes images whenever a new image is uploaded to an Amazon S3 bucket. The code runs for less than 60 seconds per image. The company wants to pay only for the compute time used and does not want to provision or manage any servers. Which AWS service best meets these requirements?
⚠ Common exam trap
Many exam-takers choose AWS Elastic Beanstalk because it automates deployment and scaling, but they overlook that it still runs on EC2 instances that incur costs continuously, not per execution, and does not provide the event-driven, pay-per-use billing model required by the question.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
AWS Lambda
AWS Lambda is the correct choice because it is a serverless compute service that runs code in response to events, such as an S3 object creation event, and automatically scales. It charges only for the compute time consumed (rounded to the nearest 1 ms) and requires no server provisioning or management. The 60-second execution limit per invocation is well within the 15-minute maximum duration of Lambda, making it ideal for short-lived image resizing tasks.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Amazon EC2
Why it's wrong here
Amazon EC2 gives you virtual machines that must be provisioned, sized, patched, and kept running. An event-driven image processing workload would either require a perpetually running instance, which costs money even during idle periods, or a complex custom pipeline using lifecycle hooks, cron jobs, or an external orchestrator to start and stop instances. For sporadic S3-triggered tasks this is over-engineered and expensive, because you are paying for and managing infrastructure instead of paying only for the actual code executions. The correct model here is serverless function compute, not IaaS.
- ✗
AWS Elastic Beanstalk
Why it's wrong here
Elastic Beanstalk is a PaaS service that automatically provisions and manages the underlying EC2 instances, load balancers, and Auto Scaling groups for a long-running web application. It is designed for continuous HTTP traffic and requires your application to be deployed as a persistent environment, not for executing short-lived, sub-second functions in response to S3 events. You still have to manage the deployment environment and pay for the underlying EC2 capacity while the environment is running, making it unnecessarily heavy for sporadic image-processing tasks.
- ✓
AWS Lambda
Why this is correct
AWS Lambda runs a function only when an event occurs, such as an S3 object creation notification, and then automatically scales to handle concurrent invocations. There is no server to provision or manage; the service executes the code in a stateless container, typically for seconds at most, and bills in 100ms increments. This exactly matches the need for short, event-driven image processing without maintaining idle infrastructure. The sub-second execution and pay-per-request pricing make it the correct choice.
- ✗
Amazon ECS
Why it's wrong here
Amazon ECS is a container orchestration service for running Docker containers, and while you can choose the Fargate launch type to avoid managing servers, it is still designed for long-running containerized applications. The task definitions and clusters are built for services that need to keep running or run scheduled batch jobs, not for binding directly to S3 events as an immediate trigger. With Fargate you would need an additional integration layer such as EventBridge to invoke tasks, and you still pay for the duration that your container remains active, which is not suited to sub-minute reactive image processing. It is a heavier, container-centric solution rather than a simple function execution.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every CLF-C02 question from scratch — 993 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CLF-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CLF-C02 exam.