%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/3522530/root/usr/lib/python2.7/site-packages/salt/states/boto_elasticache.pyo |
�
���^c @@ s( d Z d d l m Z m Z m Z d d l Z e j e � Z d � Z d � Z
d d d d d d d d e d d d d d d d d d d d � Z
d d d d d d d d d � Z d � Z e d d d d d � Z d
� Z d d d d d d � Z d d d d d d � Z d d d d d d
� Z d S( u
Manage Elasticache
==================
.. versionadded:: 2014.7.0
Create, destroy and update Elasticache clusters. Be aware that this interacts
with Amazon's services, and so may incur charges.
Note: This module currently only supports creation and deletion of
elasticache resources and will not modify clusters when their configuration
changes in your state files.
This module uses ``boto``, which can be installed via package, or pip.
This module accepts explicit elasticache 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
elasticache.keyid: GKTADJGHEIQSXMKKRBJ08H
elasticache.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 myelasticache exists:
boto_elasticache.present:
- name: myelasticache
- engine: redis
- cache_node_type: cache.t1.micro
- num_cache_nodes: 1
- notification_topic_arn: arn:aws:sns:us-east-1:879879:my-sns-topic
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# Using a profile from pillars
Ensure myelasticache exists:
boto_elasticache.present:
- name: myelasticache
- engine: redis
- cache_node_type: cache.t1.micro
- num_cache_nodes: 1
- notification_topic_arn: arn:aws:sns:us-east-1:879879:my-sns-topic
- region: us-east-1
- profile: myprofile
# Passing in a profile
Ensure myelasticache exists:
boto_elasticache.present:
- name: myelasticache
- engine: redis
- cache_node_type: cache.t1.micro
- num_cache_nodes: 1
- notification_topic_arn: arn:aws:sns:us-east-1:879879:my-sns-topic
- region: us-east-1
- profile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
i ( t absolute_importt print_functiont unicode_literalsNc C@ s d t k r d St Sd S( u)
Only load if boto is available.
u boto_elasticache.existsu boto_elasticacheN( t __salt__t False( ( ( s@ /usr/lib/python2.7/site-packages/salt/states/boto_elasticache.pyt __virtual__V s c O@ s
t | | � S( N( t present( t argst kwargs( ( s@ /usr/lib/python2.7/site-packages/salt/states/boto_elasticache.pyt cache_cluster_present` s c * C@ s( i | d 6t d 6d d 6i d 6} | r� | r� t d | | | | | � } | d } |
sc g }
n t d d | d
| d | d | d
| d | � } |
j | � d( } n t d | | | | | � } | d( k r� d } | | d <d( | d <| S| st d r'd j | � } | | d <d( | d <| St d d | d | d | d | d | d | d | d | d | d |
d | d | d | d! |
d"