# ec2\_metric\_alarm not working for Notification creation with "alarm\_actions"

**URL:** <https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [January 28, 2016, 9:49pm UTC](https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375 "2016-01-28T21:49:14Z")\
**Posts on this page:** 5\
**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 28, 2016, 9:49pm UTC](https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375/1 "2016-01-28T21:49:14Z")

</div>

I have been using the following line in “alarm\_actions” in “ec2\_metric\_alarm” module:

local\_action:  
module: ec2\_metric\_alarm  
…  
…  
…  
alarm\_actions: “arn:aws:sns:us-east-1:465404482164:Polnotify”

I did created this with “sns\_topic”. But I am not able to link it with the ec2\_metric\_alarm module. How could I solve the issue ?

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [January 29, 2016, 12:12am UTC](https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375/2 "2016-01-29T00:12:09Z")

</div>

Do you have an error message from the cli?

Does the action not get associated with the alarm? Is there an association in the AWS console?

Can you manually associate the action with the sns topic in the AWS console?

---

<div class="post-metadata">

**Author:** ![viper233](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/viper233/32/2060_2.png) [@viper233](https://forum.ansible.com/u/viper233)\
**Post date:** [January 29, 2016, 12:32am UTC](https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375/3 "2016-01-29T00:32:27Z")

</div>

"Hi, I have not got the error message though. But when I tried once more, I am able to get the notification on my E-mail as I have set up the autoscaling policy such as CPUUtilization metric. But the thing is, I cannot create notification with ansible script on autoscaling group. I have to create it manually. That’s not what I am looking for. "

You are able to create notifications/topcis with this module  
[http://docs.ansible.com/ansible/sns\_topic\_module.html](http://docs.ansible.com/ansible/sns_topic_module.html)

Keep things on the list, I’m sure everyone wants to know the solution to your problem.

---

<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 29, 2016, 5:02pm UTC](https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375/4 "2016-01-29T17:02:50Z")

</div>

I am able to create SNS topic with sns\_topic module. But How can I link it with the autoscaling group ?..Because in the auto scaling group we can clearly create the auto scaling policy and metric alarms and we can see on AWS console with ec2\_metric\_alarm or ec2\_scaling\_policy module…I have to create it manually on autoscaling group console for already available SNS ARN or is there any module in ansible which supports any parameter so that i can directly create SNS notifications in the autoscaling group ?

---

<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 29, 2016, 7:58pm UTC](https://forum.ansible.com/t/ec2-metric-alarm-not-working-for-notification-creation-with-alarm-actions/20375/5 "2016-01-29T19:58:33Z")

</div>

Hi Stephen,

Here is the thing, I did the same…It can create the autoscaling group. But the “notification” tab in the autoscaling group remains empty. Although I can see it in the Cloudwatch.

Why I cannot see it in the AWS autoscaling ? Is it something to do with the ec2\_asg ?

Here is my script,
