我为cloudtrail事件创建了cloudwatch警报。每当状态发生变化时,我都会收到电子邮件通知。但是我很难搜索在数百个实例中被删除的实例。如果我在通知电子邮件中获取实例名称会更容易。有人试过吗?
答案 0 :(得分:2)
最好的方法是:
结果将是通过电子邮件发送的这样的消息(或者您订阅了该主题):
{
"version": "0",
"id": "0c921724-d932-9cc2-b620-4053a0ad3f73",
"detail-type": "EC2 Instance State-change Notification",
"source": "aws.ec2",
"account": "123456789012",
"time": "2018-01-09T07:04:42Z",
"region": "ap-southeast-2",
"resources": [
"arn:aws:ec2:ap-southeast-2:123456789012:instance/i-0a32beef35b8da342"
],
"detail": {
"instance-id": "i-0a32beef35b8da342",
"state": "terminated"
}
}