# ec2\_metric\_alarm doesn't detect SNS notification

**URL:** <https://forum.ansible.com/t/ec2-metric-alarm-doesnt-detect-sns-notification/20363>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [January 27, 2016, 7:35pm UTC](https://forum.ansible.com/t/ec2-metric-alarm-doesnt-detect-sns-notification/20363 "2016-01-27T19:35:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhotu](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@Bhotu](https://forum.ansible.com/u/Bhotu)\
**Post date:** [January 27, 2016, 7:35pm UTC](https://forum.ansible.com/t/ec2-metric-alarm-doesnt-detect-sns-notification/20363/1 "2016-01-27T19:35:49Z")

</div>

Here is my ansible-script to create alarms and notification through ec2\_metric\_alarm module. I can successfully create the scaling part, but I cannot able to create the SNS notification.

- name: Create or delete AWS metric alarms metrics you wish to alarm on must already exists

local\_action:

module: ec2\_metric\_alarm

region: us-east-1

name: “{{ item.name }}”

state: present

metric: “CPUUtilization”

namespace: “AWS/EC2”

statistic: “Average”

comparison: “{{ item.comparison }}”

threshold: “{{ item.threshold }}”

period: 60

evaluation\_periods: 3

unit: “Percent”

dimensions:

AutoScalingGroupName: “testing-ASG”

alarm\_actions: “{{ item.alarm\_actions }}”

with\_items:

- name: “testing-SCALE-UP”

comparison: “\>=”

threshold: 70.0

alarm\_actions:

- “{{ autoscaling.results[0].arn }}”

- arn:aws:sns:us-east-1:465404434664:Polanotify

- name: “testing-SCALE-DOWN”

comparison: “\<=”

threshold: 20.0

alarm\_actions:

- “{{ autoscaling.results[1].arn }}”

- arn:aws:sns:us-east-1:465404434664:Polanotify

here is the error I am getting:

[u’arn:aws:autoscaling:us-east-1:465404434664:scalingPolicy:267c5e14-e272-4e16-9d8f-88544e9ca4ca:autoScalingGroupName/testing-ASG:policyName/Increase Group Size’, u’arn:aws:sns:us-east-1:465404434664:Polanotify’], u’name’: u’testing-SCALE-UP’}) =\> {“failed”: true, “item”: {“alarm\_actions”: [“arn:aws:autoscaling:us-east-1:465404434664:scalingPolicy:267c5e14-e272-4e16-9d8f-88544e9ca4ca:autoScalingGroupName/testing-ASG:policyName/Increase Group Size”, “arn:aws:sns:us-east-1:465404434664:Polanotify”], “comparison”: “\>=”, “name”: “testing-SCALE-UP”, “threshold”: 70.0}, “msg”: “BotoServerError: 400 Bad Request\n\<ErrorResponse xmlns="[http://monitoring.amazonaws.com/doc/2010-08-01/\](http://monitoring.amazonaws.com/doc/2010-08-01/%5C)”\>\n \n Sender\n `ValidationError`\n Invalid arn syntax: [‘arn:aws:autoscaling:us-east-1:465404434664:scalingPolicy:267c5e14-e272-4e16-9d8f-88544e9ca4ca:autoScalingGroupName/testing-ASG:policyName/Increase Group Size’, ‘arn:aws:sns:us-east-1:465404434664:Polar1notify’]\n \n 8df5ae3d-c528-11e5-9f41-2352ce248144\n\n"}

What could be the possible problem ?
