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"] '''