
Ultimate access to all questions.
Deep dive into the quiz with AI chat providers.
We prepare a focused prompt with your quiz and certificate details so each AI can offer a more tailored, in-depth explanation.
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?
A
Increase the size of the EC2 instance to process messages faster.
B
Use Amazon EventBridge to turn off the EC2 instance when the instance is underutilized.
C
Migrate the script on the EC2 instance to an AWS Lambda function with the appropriate runtime.
D
Use AWS Systems Manager Run Command to run the script on demand.
Explanation:
Correct Answer: C - Migrate the script on the EC2 instance to an AWS Lambda function with the appropriate runtime.
Cost Reduction: AWS Lambda follows a pay-per-use pricing model where you only pay for the compute time consumed while processing messages. This eliminates the need to pay for idle EC2 instance time, which significantly reduces operational costs.
Scalability: Lambda automatically scales to handle a growing number of messages in the SQS queue. As more messages arrive, Lambda can process them concurrently without any manual intervention.
SQS Integration: AWS Lambda has native integration with Amazon SQS through event source mapping. Lambda can be configured to automatically poll the SQS queue and trigger function executions when messages are available.
Maintains Processing Capability: The solution maintains the ability to process messages while optimizing costs, meeting both requirements.
A. Increase the size of the EC2 instance to process messages faster.
B. Use Amazon EventBridge to turn off the EC2 instance when the instance is underutilized.
D. Use AWS Systems Manager Run Command to run the script on demand.