AWS Certified Solutions Architect – Associate (SAA-C03) — Question 292

A company uses an Amazon EC2 instance to run a script to poll for and process messages in an Amazon Simple Queue Service (Amazon SQS) queue. The company wants to reduce operational costs while maintaining its ability to process a growing number of messages that are added to the queue.

What should a solutions architect recommend to meet these requirements?

Answer options

Correct answer: C

Explanation

Migrating the script to AWS Lambda is the most cost-effective and scalable solution because Lambda scales automatically in response to the volume of SQS messages and charges only for the exact execution time. Upgrading the EC2 instance size increases costs, while stopping the instance or using Run Command does not provide seamless, automated scaling for SQS queue polling. Therefore, a serverless architecture with AWS Lambda minimizes operational overhead and optimizes costs.