Is it possible to get or generate event for AMI availability (without polling)?

ぃ、小莉子 提交于 2021-01-29 11:17:07

问题


I'm doing large number of AMI copying to different regions, and calling describe image from image waiter at the end of copying to make sure successful copying, the large number of describe image calls are being heavily rate limited. I know there are EC2 instance state change events, I wonder if it is possible to generate AMI available/ready event, if yes I can use the event to trigger a message to my SQS, from which I can get notification and avoid making the describe image calls.

My search so far does not find any AMI events, in case I missed something, does anyone know if it is possible to generate AMI available/ready events? Thanks.


回答1:


I'm answering my owner question.

AMi ready events can be generated in CloudWatch:

rules->create new rule
  Service name: EC2
  Event Type: EBS Snapshot Notification
  Specific event(s): copySnapshot
  Specific result(s): succeeded

Hope this helps someone with similar need.




回答2:


{
  "source": [
    "aws.ec2"
  ],
  "detail-type": [
    "AWS API Call via CloudTrail"
  ],
  "detail": {
    "eventSource": [
      "ec2.amazonaws.com"
    ],
    "eventName": [
      "CreateImage"
    ]
  }
}

this will capture ami create event if cloudtrail enabled



来源:https://stackoverflow.com/questions/57368227/is-it-possible-to-get-or-generate-event-for-ami-availability-without-polling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!