我在ec2_metric_alarm
模块中创建EC2操作时遇到了困难。这是一个例子:
- name: create alarm
ec2_metric_alarm:
state: present
region: ap-southeast-2
name: "cpu-low"
metric: "CPUUtilization"
namespace: "AWS/EC2"
statistic: Average
comparison: "<="
threshold: 5.0
period: 300
evaluation_periods: 3
unit: "Percent"
description: "This will alarm when a bamboo slave's cpu usage average is lower than 5% for 15 minutes "
dimensions: {'InstanceId':'i-1234'}
alarm_actions: "action?"
我可以使用以下字符串发送电子邮件通知:arn:aws:sns:us-west-2:<account>:MyTopic
,但不知道如何构建EC2操作字符串,终止,重启,停止。
答案 0 :(得分:0)
支持的EC2操作包括:SNS和自动扩展。
Alarm action definition in ec2_metric_alarm ansible module
alarm_actions(strs列表) - 在ALARM状态下采取的动作的ARN列表
当前支持的ARNS是SNS主题或自动扩展策略。