%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/engines/ |
| Current File : //proc/thread-self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/engines/sqs_events.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 y d d l
Z e Z
Wn e k
r� e Z
n Xd d l m Z d � Z e j e � Z d d d d � Z d d d d � Z d d d d � Z d S(
u�
An engine that continuously reads messages from SQS and fires them as events.
Note that long polling is utilized to avoid excessive CPU usage.
.. versionadded:: 2015.8.0
:depends: boto
Configuration
=============
This engine can be run on the master or on a minion.
Example Config:
.. code-block:: yaml
sqs.keyid: GKTADJGHEIQSXMKKRBJ08H
sqs.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
sqs.message_format: json
Explicit sqs credentials are accepted but this engine 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 (or for ``boto`` version < 2.5.1) used you need to
specify them either in a pillar or in the config file of the master or
minion, as appropriate:
To deserialize the message from json:
.. code-block:: yaml
sqs.message_format: json
It's also possible to specify key, keyid and region via a profile:
.. code-block:: yaml
sqs.keyid: GKTADJGHEIQSXMKKRBJ08H
sqs.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
A region may also be specified in the configuration:
.. code-block:: yaml
sqs.region: us-east-1
If a region is not specified, the default is us-east-1.
It's also possible to specify key, keyid and region via a profile:
.. code-block:: yaml
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
Additionally you can define cross account sqs:
.. code-block:: yaml
engines:
- sqs_events:
queue: prod
owner_acct_id: 111111111111
i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s t s t d f St Sd S( NuK Cannot import engine sqs_events because the required boto module is missing( t HAS_BOTOt Falset True( ( ( s; /usr/lib/python2.7/site-packages/salt/engines/sqs_events.pyt __virtual___ s
c C@ s | rv t | t j � r% t | } n t | t � r= | } n | j d d � } | j d d � } | j d d � } n | s� t j d d � } n | s� t j d d � } n | s� t j d d � } n y"