
Answer-first summary for fast verification
Answer: Create an Amazon API Gateway endpoint with an AWS Lambda backend that makes a call to Amazon Simple Email Service (Amazon SES).
## Explanation **Option B is the most cost-effective solution** for the following reasons: ### Why Option B is correct: 1. **Serverless Architecture**: API Gateway + Lambda is a serverless solution that only charges for actual usage (requests processed). With fewer than 100 visits per month, this will be extremely low-cost. 2. **Pay-per-use Pricing**: Lambda charges based on the number of requests and execution time (rounded to the nearest millisecond). API Gateway also has pay-per-request pricing. 3. **No idle costs**: Unlike EC2, ECS, or Lightsail instances that run 24/7 and incur costs even when idle, serverless solutions only charge when processing requests. 4. **Amazon SES Integration**: SES is a cost-effective email service that can send emails at a very low cost per message. 5. **Maintains S3 static hosting**: The company can keep their static website on S3 and only use the serverless backend for the contact form functionality. ### Why other options are not optimal: **Option A (Amazon ECS)**: - Requires running containers 24/7, incurring continuous costs - ECS has minimum costs for cluster management and running tasks - Overkill for a simple contact form with minimal traffic **Option C (Amazon Lightsail)**: - Lightsail instances run 24/7 with fixed monthly costs - Requires converting the entire static website to dynamic, which is unnecessary - Client-side scripting alone cannot handle server-side form processing securely **Option D (EC2 t2.micro)**: - EC2 instances run 24/7 with ongoing costs - Requires managing a full LAMP stack (maintenance overhead) - Client-side scripting cannot securely process form submissions - Higher operational complexity and cost compared to serverless ### Cost Comparison: - **Option B (API Gateway + Lambda + SES)**: Likely less than $1/month for 100 visits - **Option D (EC2 t2.micro)**: ~$8-10/month (plus data transfer) - **Option C (Lightsail)**: ~$3.50-$5/month - **Option A (ECS)**: Most expensive due to container orchestration overhead ### Additional Benefits of Option B: - **Automatic scaling**: Handles traffic spikes without manual intervention - **High availability**: Built-in across multiple Availability Zones - **Security**: API Gateway provides built-in security features - **Maintenance-free**: No server patching or OS updates required For a low-traffic website with only a contact form requirement, the serverless approach (API Gateway + Lambda + SES) provides the most cost-effective solution while maintaining the simplicity of S3 static hosting.
Ultimate access to all questions.
No comments yet.
Author: LeetQuiz Editorial Team
A company hosts its static website by using Amazon S3. The company wants to add a contact form to its webpage. The contact form will have dynamic server-side components for users to input their name, email address, phone number, and user message. The company anticipates that there will be fewer than 100 site visits each month.
Which solution will meet these requirements MOST cost-effectively?
A
Host a dynamic contact form page in Amazon Elastic Container Service (Amazon ECS). Set up Amazon Simple Email Service (Amazon SES) to connect to any third-party email provider.
B
Create an Amazon API Gateway endpoint with an AWS Lambda backend that makes a call to Amazon Simple Email Service (Amazon SES).
C
Convert the static webpage to dynamic by deploying Amazon Lightsail. Use client-side scripting to build the contact form. Integrate the form with Amazon WorkMail.
D
Create a t2.micro Amazon EC2 instance. Deploy a LAMP (Linux, Apache, MySQL, PHP/Perl/Python) stack to host the webpage. Use client-side scripting to build the contact form. Integrate the form with Amazon WorkMail.