gpt4 book ai didi

amazon-web-services - 在 ec2 实例终止时获取电子邮件通知

转载 作者:行者123 更新时间:2023-12-05 05:25:32 24 4
gpt4 key购买 nike

我需要在我的实例终止时收到通知。我知道这可以通过 cloudtrail 完成,如果您收到终止事件,然后使用 sns 和 sqs 获取电子邮件。

Is there a simpler way to do that ?

任何解决方案都会受到赞赏,但我更喜欢使用 boto。

最佳答案

虽然无法在实例终止时直接从 Amazon EC2 接收通知,但有几种方法可以实现:

Auto Scaling 可以在 Auto Scaling 管理的实例 终止时发送通知。请参阅:Configure Your Auto Scaling Group to Send Notifications

AWS Config 还可以配置为在资源更改时发送简单通知服务 (SNS) 通知。这将发送许多 通知,因此您需要检查和过滤通知以找到指示实例终止的通知。请参阅以下 SNS 引用:Set Up AWS Config Using the ConsoleExample Amazon SNS Notification and Email from AWS Config .

Amazon Simple Notification Service (SNS) 也可以将消息推送到 Amazon Queuing Service (SQS),可以使用 boto python SDK 轻松轮询。

通过 CloudTrail 和 CloudWatch Logs 接收通知有点困惑,所以我推荐使用 AWS Config 方法。

关于amazon-web-services - 在 ec2 实例终止时获取电子邮件通知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30348602/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com