Hey everyone! I've been trying to manage my cloud costs better, and in April, my bill shot up to around 3 lakh INR (which is about $3,400). I started turning off my testing resources at night and on weekends, and that helped drop the cost to about $1,400. However, I find it quite tedious to run the shutdown script manually and tweak it every time there's an issue, which feels like I'm reinventing the wheel every time. I've searched online, including using GPT, but most suggestions I found are outdated. Does anyone know of any open-source or proprietary tools that automate this process specifically for turning resources off at night?
5 Answers
You might want to consider running your script as an AWS Lambda function and scheduling it using CloudWatch. This way, you won’t have to run it manually, and it can automate the shutdown process for you!
This sounds like a great approach! I might try it as well, thanks for the tip!
Check out this [GitHub repo](https://github.com/AvinashDalvi89/list-of-AWS-kickstart-projects/tree/main/park-your-ec2-instances) for a way to park your EC2 instances using Lambda. It’s pretty straightforward—you can tag your resources by environment and set CloudWatch rules to shut them down after hours. I saved about 50% on costs with this!
AWS also has an Instance Scheduler solution if you want to check that out!
If you think scripting is tedious, maybe the cloud isn't for you! There's always a bit of management involved—just part of the game!
True, but nobody wants to keep doing those repetitive tasks nowadays. Tech should make things easier!
You might not need any extra software for this. AWS Systems Manager has a free Resource Scheduler that can turn your instances on and off at specific times. We use it for our dev and test environments, which has been a game changer!
We actually use a similar setup! We trigger a Python Lambda with EventBridge Scheduler to start and stop our infrastructure. The Python script can be simple or complex depending on your needs.