
Answer-first summary for fast verification
Answer: Create AWS Lambda functions to start and stop the DB instance. Create Amazon EventBridge (Amazon CloudWatch Events) scheduled rules to invoke the Lambda functions. Configure the Lambda functions as event targets for the rules.
## Explanation **Correct Answer: D** This is the most appropriate solution for minimizing costs for an RDS DB instance that only needs to run 12 hours per day. ### Why Option D is Correct: 1. **AWS Lambda + EventBridge Scheduled Rules**: This approach allows for automated start/stop of the RDS instance on a schedule 2. **Cost Optimization**: RDS instances are billed by the hour when running. By stopping the instance during off-hours (12 hours per day), the company only pays for storage costs during the stopped period, not compute costs 3. **Serverless Architecture**: Lambda functions are event-driven and cost-effective (pay-per-use) 4. **Reliable Scheduling**: EventBridge provides reliable scheduled event delivery ### Why Other Options are Incorrect: **Option A**: AWS Systems Manager Session Manager is for managing EC2 instances, not for starting/stopping RDS instances. RDS doesn't have built-in automatic start/stop functionality. **Option B**: ElastiCache doesn't solve the core problem. While caching can improve performance, it doesn't reduce RDS costs when the database is stopped. Users cannot access data from cache if the underlying RDS instance is stopped because the cache would eventually become stale and invalid. **Option C**: Launching an EC2 instance to manage RDS start/stop adds unnecessary complexity and cost. The EC2 instance itself would need to run continuously to execute the cron jobs, defeating the cost-saving purpose. ### Key AWS Services for Cost Optimization: - **AWS Lambda**: Serverless compute for start/stop operations - **Amazon EventBridge**: For scheduling the start/stop events - **Amazon RDS**: Can be started/stopped via API calls ### Implementation Steps: 1. Create IAM role with permissions to start/stop RDS instances 2. Create Lambda functions that call `StartDBInstance` and `StopDBInstance` API operations 3. Create EventBridge scheduled rules for daily start and stop times 4. Configure Lambda functions as targets for the EventBridge rules This solution minimizes costs while maintaining the required availability during business hours.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
A company uses a three-tier web application to provide training to new employees. The application is accessed for only 12 hours every day. The company is using an Amazon RDS for MySQL DB instance to store information and wants to minimize costs. What should a solutions architect do to meet these requirements?
A
Configure an IAM policy for AWS Systems Manager Session Manager. Create an IAM role for the policy. Update the trust relationship of the role. Set up automatic start and stop for the DB instance.
B
Create an Amazon ElastiCache for Redis cache cluster that gives users the ability to access the data from the cache when the DB instance is stopped. Invalidate the cache after the DB instance is started.
C
Launch an Amazon EC2 instance. Create an IAM role that grants access to Amazon RDS. Attach the role to the EC2 instance. Configure a cron job to start and stop the EC2 instance on the desired schedule.
D
Create AWS Lambda functions to start and stop the DB instance. Create Amazon EventBridge (Amazon CloudWatch Events) scheduled rules to invoke the Lambda functions. Configure the Lambda functions as event targets for the rules.