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,
---
- name: Start Autoscaling Configurations
hosts: awsserver
gather_facts: no
tasks:
- name: Autoscaling Starts Now...!!!!!
local_action:
module: ec2_scaling_policy
region: us-east-1
name: "{{ item.name }}"
asg_name: "testing-ASG"
state: present
adjustment_type: "{{ item.adjustment_type }}"
min_adjustment_step: "{{ item.min_adjustment_step }}"
scaling_adjustment: "{{ item.scaling_adjustment }}"
cooldown: "{{ item.cooldown }}"
with_items:
- name: "Increase Group Size"
adjustment_type: "ChangeInCapacity"
scaling_adjustment: +1
min_adjustment_step: 1
cooldown: 170
- name: "Decrease Group Size"
adjustment_type: "ChangeInCapacity"
scaling_adjustment: -1
min_adjustment_step: 1
cooldown: 290
register: autoscaling
- 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:465404420665:Polanotify'
- name: "testing-SCALE-DOWN"
comparison: "<="
threshold: 20.0
alarm_actions:
- '{{ autoscaling.results[1].arn }}'
- 'arn:aws:sns:us-east-1:465404420665:Polanotify'
So, I have done the above part.. What could be the possible problem ?.. I
want to see the notification in "Notification" tab with this script.
On Thursday, 28 January 2016 13:49:14 UTC-8, Bhotu wrote:
>
> 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 ?
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/241854c6-cb2b-4e66-b830-5cd5bdc37295%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.