%PDF- %PDF-
| Direktori : /proc/self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyo |
�
���^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 � Z d d d d d d d d d d d d � Z d d d d d � Z d S(
u:
Manage Elasticsearch Domains
============================
.. versionadded:: 2016.11.0
Create and destroy Elasticsearch domains. 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
vpc.keyid: GKTADJGHEIQSXMKKRBJ08H
vpc.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 domain exists:
boto_elasticsearch_domain.present:
- DomainName: mydomain
- profile='user-credentials'
- ElasticsearchVersion: "2.3"
- ElasticsearchClusterConfig:
InstanceType": "t2.micro.elasticsearch"
InstanceCount: 1
DedicatedMasterEnabled: False
ZoneAwarenessEnabled: False
- EBSOptions:
EBSEnabled: True
VolumeType: "gp2"
VolumeSize: 10
Iops: 0
- AccessPolicies:
Version: "2012-10-17"
Statement:
- Effect: "Allow"
- Principal:
AWS: "*"
- Action:
- "es:*"
- Resource: "arn:aws:es:*:111111111111:domain/mydomain/*"
- Condition:
IpAddress:
"aws:SourceIp":
- "127.0.0.1"
- "127.0.0.2"
- SnapshotOptions:
AutomatedSnapshotStartHour: 0
- AdvancedOptions:
rest.action.multi.allow_explicit_index": "true"
- Tags:
a: "b"
- 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_elasticsearch_domain.existsu boto_elasticsearch_domain( t __salt__t False( ( ( sI /usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyt __virtual___ s c C@ s t d | | � S( Nu boto3.json_objs_equal( t __utils__( t currentt desired( ( sI /usr/lib/python2.7/site-packages/salt/states/boto_elasticsearch_domain.pyt
_compare_jsonf s u 1.5c
C@ s i | d 6t d 6d d 6i d 6}
| d: k rS i t d 6d d 6d d
6t d 6} n | d: k ro i t d 6} n | d: k r� i d
d 6} n | d: k r� i d d 6} n | d: k r� i } n | d: k r-t | t j � r-y t j j j | � } Wq-t
k
r)} t |
d <d j | j � |
d <|
SXn 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 <d: |
d <|
St
d d | d | d | d | d! | d"