AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A financial services company is modernizing a monolithic application that runs on a fleet of Amazon EC2 instances. A key component of this application is a report generation process that is triggered whenever a new data file is uploaded to an Amazon S3 bucket. This process aggregates data and performs complex calculations, occasionally taking up to 25 minutes to complete. The workload is highly variable, with long idle periods followed by intense, unpredictable bursts of activity. A solutions architect must design a new architecture for this process that is serverless, event-driven, and cost-effective.
Which approach MOST effectively meets these requirements?
Configure a single AWS Lambda function with maximum memory and a 15-minute timeout. Use Amazon S3 event notifications to trigger the function and configure a dead-letter queue (DLQ) to handle timeouts.
Use Amazon S3 event notifications to send a message to an Amazon SQS queue. Configure an EC2 Auto Scaling group to process messages from the queue, scaling the number of instances based on queue depth.
Package the process into a container and run it as an AWS Fargate task. Use an Amazon EventBridge rule to trigger the task in response to the S3 object creation event.
Refactor the report generation process into a series of smaller AWS Lambda functions orchestrated by an AWS Step Functions state machine. Trigger the state machine execution from the S3 event.
The correct answer is to use AWS Step Functions to orchestrate a series of AWS Lambda functions. This approach directly addresses the primary challenge, which is the potential for the process to exceed the 15-minute maximum execution time of a single AWS Lambda function. By breaking the long-running process into smaller, sequential tasks, each can be executed by a separate Lambda function within its time limit. AWS Step Functions manages the state, sequencing, and error handling between these functions, effectively creating a long-running, resilient, and serverless workflow. This architecture is event-driven, triggered by the S3 event, and is highly cost-effective because you only pay for the Step Functions state transitions and the actual compute time of the Lambda functions, which aligns perfectly with the unpredictable, bursty workload.
Using a single Lambda function is incorrect because it cannot handle processes that run longer than its 15-minute maximum timeout. While a Dead Letter Queue (DLQ) can handle failures, it doesn't solve the fundamental execution time limitation.
Using AWS Fargate is a plausible but less optimal solution. While Fargate can handle long-running containerized tasks without a 15-minute limit, it is generally less cost-effective for highly sporadic and unpredictable workloads compared to the pay-per-execution model of Lambda and Step Functions. The Lambda and Step Functions combination is more aligned with a purely event-driven, function-based modernization approach.
Using an SQS queue with an EC2 Auto Scaling group is not a serverless approach. This pattern requires managing EC2 instances, which is what the company is trying to modernize away from. It is less efficient for handling sudden bursts due to the time it takes for new EC2 instances to launch and is not as cost-effective during long idle periods.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What makes AWS Step Functions suitable for long-running processes?
Open an interactive chat with Bash
How does an event-driven architecture benefit this workload?
Open an interactive chat with Bash
Why is using Lambda with Step Functions more cost-effective than AWS Fargate?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Accelerate Workload Migration and Modernization
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access