Which solution will meet these requirements?
Scale the EC2 instances by using elastic resize. Scale the DB instances to zero outside of business hours.
Explore AWS Marketplace for partner solutions that will automatically start and stop the EC2 instances and DB instances on a schedule.
Launch another EC2 instance. Configure a crontab schedule to run shell scripts that will start and stop the existing EC2 instances and DB instances on a schedule.
Create an AWS Lambda function that will start and stop the EC2 instances and DB instances. Configure Amazon EventBridge to invoke the Lambda function on a schedule.
Explanations:
While scaling EC2 instances can help reduce costs, it does not automatically start and stop instances. Additionally, Amazon RDS does not support scaling to zero; therefore, DB instances cannot be stopped completely outside business hours.
Although AWS Marketplace may have solutions for scheduling instance management, it does not guarantee a built-in, managed solution by AWS. This approach could increase costs and maintenance since third-party solutions might require additional management.
This solution involves launching an additional EC2 instance to manage the start/stop schedule, which adds infrastructure overhead and maintenance. It also requires managing the crontab and shell scripts, leading to more complexity and potential points of failure.
This solution leverages AWS Lambda, which is serverless and requires no infrastructure management. By using Amazon EventBridge to trigger the Lambda function on a schedule, it automates the start and stop of both EC2 instances and RDS DB instances efficiently and cost-effectively.