Created
June 22, 2018 01:47
-
-
Save naavveenn/01e5d9a3358738c1ec150bafbbe0c58b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: local | |
connection: local | |
vars_files: | |
- /home/ansible/tbb_awscreds.yml | |
tasks: | |
- name: Create a Basic CPU Alarm | |
ec2_metric_alarm: | |
aws_access_key: "{{ aws_id }}" | |
aws_secret_key: "{{ aws_key }}" | |
region: "{{ aws_region }}" | |
state: present | |
name: "msp-ecs-{{ item }}-CPUUtilization-Critical (MSP)" | |
metric: "CPUUtilization" | |
namespace: "AWS/ECS" | |
statistic: Average | |
comparison: ">=" | |
threshold: 90.0 | |
period: 300 | |
evaluation_periods: 1 | |
unit: "Percent" | |
description: "This alarm triggers when CPU is greater than 90% for 5 minutes" | |
dimensions: {'ClusterName': "{{ cluster }}"} | |
alarm_actions: ['arn:aws:sns:ap-south-1:652024084351:TataSkyBB-MSP-Alerts'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ansible-playbook ecs.yml --extra-vars "cluster=prod-cluster"