%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/thread-self/root/lib/python2.7/site-packages/salt/states/boto3_sns.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 Z d d l
m Z e j e
� Z d � Z d d d d d d d � Z e d d d d d � Z d � Z d S( u�
Manage SNS Topics
Create and destroy SNS topics. 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 AWS 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
sns.keyid: GKTADJGHEIQSXMKKRBJ08H
sns.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
mytopic:
boto3_sns.topic_present:
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# Using a profile from pillars
mytopic:
boto3_sns.topic_present:
- region: us-east-1
- profile: mysnsprofile
# Passing in a profile
mytopic:
boto3_sns.topic_present:
- region: us-east-1
- profile:
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 boto3_sns.topic_existsu boto3_sns( t __salt__t False( ( ( s9 /usr/lib/python2.7/site-packages/salt/states/boto3_sns.pyt __virtual__E s c
C@ s� i | d 6t d 6d d 6i d 6} t } t d | | | | | � } | rj d j | � | d <| d }
n� t d r� d
j | � | d <d, | d <| St d | d | d
| d | d | �}
|
r� d j | |
� | d <t } n2 d j | � | d <t j | d � t | d <| S| r | n i } t d |
d | d
| d | d | �} x?d d d g D].}
| j |
� } | j |
� } | d, k r�q^n t | | � r�q^n t d r�| d c d j |
|
� 7<d, | d <q^n t
| t j � r�| n t
j j j | � } t d |
|
| d | d
| d | d | �rb| d c d j |
| |
� 7<t } q^| d c d j |
|
� 7<t | d <| Sq^W| r�| n g } g } | j d g � } g | D]"