%PDF- %PDF-
| Direktori : /usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //usr/lib/python2.7/site-packages/salt/states/boto_cloudwatch_event.pyc |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m
Z
e j e � Z
d � Z d d d d d d d d d d d d � Z d d d d d d � Z d S( u�
Manage CloudTrail Objects
=========================
.. versionadded:: 2016.11.0
Create and destroy CloudWatch event rules. Be aware that this interacts with Amazon's services,
and so may incur charges.
This module uses ``boto3``, which can be installed via package, or pip.
This module accepts explicit vpc 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 `here
<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 file or
in the minion's config file:
.. code-block:: yaml
cloudwatch_event.keyid: GKTADJGHEIQSXMKKRBJ08H
cloudwatch_event.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
It's also possible to specify ``key``, ``keyid`` and ``region`` via a profile,
either passed in as a 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
Ensure event rule exists:
boto_cloudwatch_event.present:
- Name: mytrail
- ScheduleExpression: 'rate(120 minutes)'
- State: 'DISABLED'
- Targets:
- Id: "target1"
Arn: "arn:aws:lambda:us-west-1:124456715622:function:my_function"
Input: '{"arbitrary": "json"}'
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s d t k r d St S( u)
Only load if boto is available.
u boto_cloudwatch_event.existsu boto_cloudwatch_event( t __salt__t False( ( ( sE /usr/lib/python2.7/site-packages/salt/states/boto_cloudwatch_event.pyt __virtual__E s c C@ s, i | d 6t d 6d d 6i d 6} | r. | n | } t | t j � r^ t j j j | � } n | d0 k rs g } n t d d | d | d | d
|
d | � }
d |
k r� t
| d <d
j |
d d � | d <| S|
j d � s�t
d r
d j | � | d <d0 | d <| St d d | d | d | d | d | d | d | d | d
|
d | �
}
|
j d � s�t
| d <d
j |
d d � | d <| St d | d | d | d
|
d | �} d | k r�t
| d <d
j | d d � | d <i | d <| Si d0 d 6| d d <| | d d <d j | � | d <t | � r�t d d | d | d | d | d
|
d | � }
d |
k r�t
| d <d
j |
d d � | d <i | d <| S| | d d d d! <n | St j j | d d"