CFO recently analyzed company’s AWS monthly bill and identified an opportunity to reduce cost for EB envs in use. CFO has asked SA to design a highly available solution that will spin up an EB env in the morning and terminate it at EOD.
The solution should be designed with minimal operational overhead and to minimize costs. It should also be able to handle the increased use of EB envs among different teams, and must provide a one-stop scheduler solution for all teams to keep the operational costs low.
What design will meet these requirements?
A. Set up a Linux EC2 Micro instance. Configure an IAM role to allow the start and stop of the EB env and attach it to the instance. Create scripts on the instance to start and stop the EB env. Configure cron jobs on the instance to execute the scripts.
B. Develop Lambda functions to start and stop the EB env. Configure a Lambda execution role granting EB env start/stop permissions, and assign the role to the Lambda functions. Configure cron expression CW Events rules to trigger the Lambda functions.
C. Develop an AWS Step Functions state machine with “wait” as its type to control the start and stop time. Use the activity task to start and stop the EB env. Create a role for Step Functions to allow it to start and stop the EB env. Invoke Step Functions daily.
D. Configure a time-based ASG. In the morning, have the ASG scale up an EC2 instance and put the EB env start command in the EC2 instance user date. At the end of the day, scale down the instance number to 0 to terminate the EC2 instance.
B: 参考 https://aws.amazon.com/premiumsupport/knowledge-center/schedule-elastic-beanstalk-stop-restart/