Courseiva
Cloud Technology and ServicesmediumMultiple ChoiceObjective-mapped

CLF-C02 Cloud Technology and Services Practice Question

A developer wants to run code in response to an S3 object upload without managing any servers. The code runs for less than 5 minutes. Which AWS service is most appropriate?

⚠ Common exam trap

Many exam-takers confuse AWS Fargate (serverless containers) with AWS Lambda (serverless functions), but Fargate still requires container management and is not event-driven by S3 uploads without additional services like EventBridge or S3 Event Notifications to a custom endpoint.

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 most appropriate service because it is a serverless compute service that automatically runs code in response to events, such as an S3 object upload, without requiring any server management. Lambda supports code execution up to 15 minutes per invocation, which easily accommodates the less-than-5-minute requirement, and it integrates natively with S3 event notifications via the S3 bucket notification configuration.

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 provides raw virtual servers that require continuous patching, capacity planning, and manual scaling, and an idle instance still incurs charges even when no files are being processed. To make EC2 event-driven, you would need to set up a polling mechanism or additional tooling, increasing latency and cost. For sporadic S3 processing, an always-on EC2 instance is grossly over-engineered, and even a short-lived instance spun up on demand would face startup delays that Lambda avoids.

  • AWS Fargate

    Why it's wrong here

    AWS Fargate is the serverless compute engine for ECS and EKS, but it still requires you to build, store, and configure a container image and define a task or pod specification before running. Fargate also bills by the second for the entire time a task runs, which is inefficient for a rapid, one-off event like an S3 object creation where the processing might finish in under a second. It excels at long-running batch processing or web APIs, not fine-grained event-driven file transformations — that's Lambda's domain.

  • AWS Lambda

    Why this is correct

    AWS Lambda is the native serverless compute service that runs code in response to S3 event notifications without any server provisioning or patching. It scales automatically with each event, bills only for the duration your function executes (rounded to the nearest millisecond), and is ideal for short-duration processing such as image resizing or metadata extraction when an object is uploaded. With a maximum invocation timeout of 15 minutes, Lambda handles this exact use case while requiring no infrastructure to manage.

  • Amazon ECS

    Why it's wrong here

    Amazon ECS is a container orchestration service that necessitates cluster management, task definition registration, and choice of Fargate or EC2 launch types before any code can run. To respond to S3 uploads, you must build a Docker image, configure auto-scaling policies, and often route the event through Lambda or EventBridge, adding unnecessary complexity. ECS is designed for long-running or stateful microservices, so using it for a simple, event-triggered file processing routine violates the principle of matching compute service to workload granularity.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

This CLF-C02 question is part of Courseiva's 988-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.