AWS Certified Cloud Practitioner / Question #1183 of 719

Question #1183

A company is developing an event-driven application and needs a serverless compute service to execute code in response to events without managing infrastructure. Which AWS service should they use?

A

AWS Lambda

B

AWS Fargate

C

Amazon EC2

D

AWS Batch

Explanation

AWS Lambda (A) is designed for event-driven architectures, allowing code execution in response to triggers like S3 uploads, DynamoDB updates, or API Gateway requests. It abstracts infrastructure management, scales automatically, and charges only for compute time used.

Other options are incorrect because:
- AWS Fargate (B): A serverless compute engine for containers (ECS/EKS), but requires defining tasks/services rather than direct event-driven code execution.
- Amazon EC2 (C): Requires manual infrastructure management (e.g., servers, scaling), which contradicts the serverless requirement.
- AWS Batch (D): Focuses on batch processing jobs, not real-time event-driven workflows.

Key Takeaway: Lambda is the go-to AWS service for serverless, event-triggered compute scenarios.

Answer

The correct answer is: A