ec2_metric_alarm not working for Notification creation with "alarm_actions"

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 ?

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?

"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

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

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 ?

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,