File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/boto_cloudwatch_alarm.cpython-310.pyc
Back
o ;jA � @ s, d Z ddlZdd� Zd dd�Zd dd�ZdS ) a� Manage Cloudwatch alarms .. versionadded:: 2014.7.0 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 through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html 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: .. code-block:: yaml myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1 .. code-block:: yaml 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 � Nc C s dt v rdS dS )z) Only load if boto is available. �boto_cloudwatch.get_alarmZboto_cloudwatch_alarm)Fz*boto_cloudwatch module could not be loaded)�__salt__� r r �U/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/boto_cloudwatch_alarm.py�__virtual__: s r c C sR | ddi d�}t d | ||||�}dD ]}||v r't d || ||||�||<