使用此tutorial我创建了一个lambda函数,当它失败时,云计时警报会导致SNS使用lambda错误度量标准发送电子邮件。我正在使用它来检查是否有任何ec2实例正在upcomming scheduled events。眼下,这是信息的CloudWatch和SNS在发送电子邮件的:如何更改cloudwatch SNS电子邮件?
Alarm Details:
- Name: ec2-scheduled-events-alarm
- Description: an ec2 instance has an upcomming scheduled event
- State Change: OK -> ALARM
- Reason for State Change: Threshold Crossed: 1 datapoint (1.0) was greater than or equal to the threshold (1.0).
- Timestamp: Wednesday 12 September, 2016 00:16:54 UTC
- AWS Account: ..........
Threshold:
- The alarm is in the ALARM state when the metric is GreaterThanOrEqualToThreshold 1.0 for 300 seconds.
Monitored Metric:
- MetricNamespace: AWS/Lambda
- MetricName: Errors
- Dimensions:
- Period: 300 seconds
- Statistic: Sum
- Unit: not specified
State Change Actions:
- OK:
- ALARM: [arn:aws:sns:us-west-2:..........:ec2-scheduled-events]
- INSUFFICIENT_DATA:
我想改变这条消息也包含来自我的拉姆达脚本信息(如列明EC2实例我定义为不及格)。我怎样才能做到这一点?我猜测它涉及以某种方式改变Monitored Metric:
- Dimensions:
的输出。
或更好的但我怎么才能让我的电子邮件包含我的lambda函数的日志输出?