AWS CloudWatch警报到多个EC2实例 [英] AWS CloudWatch Alarms to multiple EC2 instances

查看:102
本文介绍了AWS CloudWatch警报到多个EC2实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想应用CloudWatch警报来停止在生产前环境中未使用的实例。我们经常会实例被旋转,使用然后打开,这确实开始使我们花费大量金钱。

I'm wanting to apply a CloudWatch alarm to stop instances which aren't being used in our pre-production environment. We often have instances being spun up, used and then left turned on which is really starting to cost us a fair amount of money.

CloudWatch警报具有方便的功能,通过它我们可以根据一些指标停止运行-这太了不起了,我想用它不断监控服务器但让它为我整理实例。

CloudWatch alarms have a handy feature whereby we can stop based on some metrics - this is awesome and what I'd like to use to constantly keep an eye on the servers with but let it tidy up the instances for me.

问题在于,似乎需要针对每个实例分别创建CloudWatch警报。有没有一种方法可以创建一个警报,该警报将在将要启动的所有当前和将来的实例之间共享值?

The problem with this is that it appears that the CloudWatch alarms need to be created individually against each instance. Is there a way in which I can create one alarm which would share values across all current and future instances which will be started?

ETA-另外,告诉我,这些选择比CloudWatch更好,我会很高兴的。

ETA - Alternatively, tell me that these options are better than CloudWatch and I'll be happy at that.

AWS EC2通过PowerShell / CMD工具停止所有操作

推荐答案

向基本映像添加创建CloudWatch警报的启动脚本

Add a startup script that creates the CloudWatch alarm to the base image you use to generate your VMs.

http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/CLIReference.html

这篇关于AWS CloudWatch警报到多个EC2实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆