使用 AWS 预算停止服务 [英] Using AWS budgets to stop a services
问题描述
我目前已注册 AWS 免费套餐.我很享受尝试各种服务,包括上述免费套餐无法提供的服务.如果我不小心花费过多,AWS 的增强预算是否可以用于停止 EC2 实例等服务?或者它们只是充当警报?
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?
推荐答案
没有内置的方法可以根据预算或账单警报终止服务.
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.
您真的希望 AWS 自动终止您的生产基础设施,因为您比估计的每月支出多出 1 美元吗?
Would you really want AWS automatically terminating your production infrastructure because you went $1 over your estimated monthly spending?
现在有一种方法可以监控免费层使用情况并发出警报,以及您的预测使用量何时会超过免费层.请参阅此处了解详情.您可能会想出一种基于使用 SNS & 的警报来终止基础设施的方法.拉姆达.
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.
编辑 2:在 2020 年 10 月,AWS 发布了预算操作 - 在达到预算阈值时触发操作的能力.这应该使您能够自动响应 - 您可以关闭服务器、更改 IAM 权限以防止创建其他基础设施等.
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.
这篇关于使用 AWS 预算停止服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!