【发布时间】:2020-08-18 13:55:14
【问题描述】:
其实我想减少 AWS 账单。我在我的项目中使用了一些实例。我希望在我的登录电子邮件 ID 上的特定时间段(每 3/4 小时)后收到通知,并在特定时间段内关闭。那么,我该怎么做呢?
if current time - instance start time >= 3 hr (send a mail)
if current time - instance start time >= 4 hr (send a mail)
if current time - instance start time >= 5 hr (shut down that instance)
【问题讨论】:
-
没有内置功能来执行您的请求,但您可以使用 AWS Lambda 函数自行编写代码。另见:Use Amazon CloudWatch to Detect and Shut Down Unused Amazon EC2 Instances
-
谢谢你,我已经编辑了,你可以看看更好的理解。
-
将 lambda 函数的目标添加到 SNS 时出现错误。
Your function's execution role doesn't have permission to send result to the destination. By clicking save we'll attempt to add permission to the role for you.。我给出了两个策略(EC2FullAccess 和 SNSFullAccess)。为什么显示你没有权限?它还需要哪些政策? -
为什么要为 Lambda 函数定义目标?
-
仅供参考,根据您的要求,我是 writing a few Stopinators。 Stopinator Type 2 处理“停止后”,但还没有通知。
标签: amazon-web-services amazon-ec2 aws-lambda amazon-cloudwatch amazon-sns