| I am new here so please forgive me if I'm stepping out of line here. Long story short, I recently got an aws account for side projects but I am scared that someday someone's going to go crazy with one of my public websites and I'd end up with a large $XXX bill. I have also heard horror stories from this sub about people trying something or forgetting to turn resources off and ending up with a large budget. I know we can set budgets and all but it doesn't work for people who want to cap the total $ spent. I am a little surprised aws hasen't introduced this feature despite many requests (although when I think from a business pov, it makes sense). Basically I am want to create an app where you could say something like "I ONLY want to spend $XX per month, if my bill is more than that, shutdown my resources" My idea is to create a website where you can set a budget amount (monthly?) for your account and setup rules for different resources ( like shutdown EC2, make S3 bucket private etc) I am pretty good with creating backend tools and worked a lot with aws lambdas and s3. I'd love to get some ideas from you guys. Also if you don't think its gonna be helpful, let me know that too. thanks |
The biggest question is "where are you going to get your data about current spend?. AFAIK the budget data lags behind usage (which is what I assume is the reason people haven't done this before). You can do this at a per-service level (e.g. EC2) by periodically polling EC2 for active resources and keeping a running tally of cost by yourself. This works well for some services like EC2, RDS (although serverless Aurora gets tricky), etc. However for other managed services like S3 or Lambda, it's harder to keep track of how much you have spent.
Cloudtrail could be useful here, but it probably doesn't have enough information to calculate actual cost (e.g. Lambda charging based on invocation time or Athena charging based on the volume of data scanned).
But even something as simple as a tool that keeps track of just your EC2 instance spend and shuts them down if it gets too high would be useful to developers who have AWS accounts for their side projects.