Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using AWS budgets to stop a services

Tags:

I am currently signed up to the free tier of AWS. I am enjoying experimenting with various services including those not affording by said free tier. Can AWS's enhanced budgets be used to stop services like EC2 instances if I accidentally spend too much? Or do they merely act as alerts?

like image 771
David Stewart Avatar asked Oct 16 '17 15:10

David Stewart


People also ask

What is the purpose of an AWS budget?

AWS Budgets lets you set custom cost and usage budgets that alert you when your budget thresholds are exceeded (or forecasted to exceed). You can also create budgets to track your aggregate Reservation and Savings Plans utilization and coverage metrics.

Which budget types can be created under AWS budgets?

You can create the following types of budgets: Cost budgets – Plan how much you want to spend on a service. Usage budgets – Plan how much you want to use one or more services. RI utilization budgets – Define a utilization threshold and receive alerts when your RI usage falls below that threshold.

What is the main goal for creating a usage budget type in AWS budgets?

What is the main goal for creating a Usage budget type (in AWS Budgets)? C. Reservation budgets track the status of any active reserved instances on your account. that correlates usage per unit cost to understand your account cost efficiency.

What services can you access to control your spending AWS?

Getting Started From there, you can access a number of products that can help you to better understand, analyze, and control your AWS costs, including, but not limited to, AWS Cost Explorer, AWS Budgets, and the AWS Cost & Usage Report.


2 Answers

There is no built-in way to terminate services based on budgets or billing alarms.

You can get notified automatically, but it is then up to you to determine how to handle it.

Would you really want AWS automatically terminating your production infrastructure because you went $1 over your estimated monthly spending?

Edit: There is now a way to monitor and alert on free tier usage, and when your predicted usage will exceed the free tier. See here for details. You could probably come up with a way to terminate infrastructure based on an alert using SNS & lambda.

Edit 2: In Oct. 2020, AWS released Budget Actions - the ability to trigger an action when a budget thresholds are reached. This should give you the ability to automate a response - you can shut down servers, change IAM permissions to prevent additional infrastructure from being created, etc.

like image 137
chris Avatar answered Sep 29 '22 03:09

chris


This is available for EC2, I don't think it is available for all of the AWS resources.

http://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/UsingAlarmActions.html

Hope it helps.

like image 34
Kannaiyan Avatar answered Sep 29 '22 02:09

Kannaiyan