Manage Cloudwatch alarms
Create and destroy cloudwatch alarms. Be aware that this interacts with Amazon's services, and so may incur charges.
This module uses boto, which can be installed via package, or pip.
This module accepts explicit credentials but can also utilize IAM roles assigned to the instance trough Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:
If IAM roles are not used you need to specify them either in a pillar or in the minion's config file:
cloudwatch.keyid: GKTADJGHEIQSXMKKRBJ08H cloudwatch.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
It's also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:
myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1
my test alarm: boto_cloudwatch_alarm.present: - name: my test alarm - attributes: metric: ApproximateNumberOfMessagesVisible namespace: AWS/SQS statistic: Average comparison: ">=" threshold: 20000.0 period: 60 evaluation_periods: 1 description: test alarm via salt dimensions: QueueName: - the-sqs-queue-name alarm_actions: - arn:aws:sns:us-east-1:1111111:myalerting-action
absent(name, region=None, key=None, keyid=None, profile=None)¶
Ensure the named cloudwatch alarm is deleted.
present(name, attributes, region=None, key=None, keyid=None, profile=None)¶
Ensure the cloudwatch alarm exists.