Hello SAS Community,
We are in the process of moving some services to the AWS cloud and have around 8 SAS instances running. Our goal is to create an automation script to shut these instances down during off-hours to save costs.
![orbar_0-1718803506318.png orbar_0-1718803506318.png](https://communities.sas.com/t5/image/serverpage/image-id/97629iFA25AE3852ACA6C8/image-size/medium?v=v2&px=400)
Here are a few specific questions we have:
- Shutdown Mechanism: When shutting down an EC2 instance using AWS commands, does it perform a graceful shutdown similar to a normal OS shutdown, or is it more like pulling the power cord?
- Shutdown Order: Is there a best practice for the order in which to shut down and start up instances? For example, should databases be shut down last and started first?
- Automation Tools: What are the recommended tools or methods for automating this process? We've looked into AWS Lambda and AWS Systems Manager but would appreciate guidance or examples.
- Handling Dependencies: How do we ensure that dependent services are shut down in the correct order to prevent issues?
Here is what we are currently considering:
- Using AWS Lambda triggered by CloudWatch Events to stop instances.
- Ensuring that our shutdown sequence handles dependencies correctly (e.g., web servers -> application servers -> databases).
Any insights, best practices, or sample scripts would be greatly appreciated!
Thanks in advance for your help!