From 7fd31b1da007a0c4a11df22c1d22e66e49938317 Mon Sep 17 00:00:00 2001 From: Chas Schley Date: Wed, 17 Oct 2018 10:39:03 -0700 Subject: [PATCH] [docs] Include required ARN format of actions in ec2_metric_alarm (#46514) +label: docsite_pr --- .../modules/cloud/amazon/ec2_metric_alarm.py | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py b/lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py index e3f0a3cd93..c9e790a25f 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py +++ b/lib/ansible/modules/cloud/amazon/ec2_metric_alarm.py @@ -103,7 +103,7 @@ options: required: false alarm_actions: description: - - A list of the names action(s) taken when the alarm is in the 'alarm' status + - A list of the names action(s) taken when the alarm is in the 'alarm' status, denoted as Amazon Resource Name(s) required: false insufficient_data_actions: description: @@ -111,7 +111,7 @@ options: required: false ok_actions: description: - - A list of the names of action(s) to take when the alarm is in the 'ok' status + - A list of the names of action(s) to take when the alarm is in the 'ok' status, denoted as Amazon Resource Name(s) required: false extends_documentation_fragment: - aws @@ -136,6 +136,22 @@ EXAMPLES = ''' dimensions: {'InstanceId':'i-XXX'} alarm_actions: ["action1","action2"] + - name: Create an alarm to recover a failed instance + ec2_metric_alarm: + state: present + region: us-west-1 + name: "recover-instance" + metric: "StatusCheckFailed_System" + namespace: "AWS/EC2" + statistic: "Minimum" + comparison: ">=" + threshold: 1.0 + period: 60 + evaluation_periods: 2 + unit: "Seconds" + description: "This will recover an instance when it fails" + dimensions: {"InstanceId":'i-XXX'} + alarm_actions: ["arn:aws:automate:us-west-1:ec2:recover"] '''