%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/states/ |
Current File : //lib/python2.7/site-packages/salt/states/boto3_route53.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 m Z d d l Z d d l Z e j e � Z d � Z e e e e e e e e e d � Z e e e e e e d � Z e e e e e e e e e e e e e e e e e e e d � Z e e e e e e e e e e d � Z d S( u� Manage Route53 records with Boto 3 .. versionadded:: 2017.7.0 Create and delete Route53 records. 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 route53 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 route53.keyid: GKTADJGHEIQSXMKKRBJ08H route53.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 An exciting new AWS Route 53 Hosted Zone: boto_route53.hosted_zone_present: - Name: example.com. - PrivateZone: true - VPCs: - VPCName: MyLittleVPC VPCRegion: us-east-1 - VPCId: vpc-12345678 - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs mycnamerecord: boto_route53.rr_present: - Name: test.example.com. - ResourceRecords: - my-elb.us-east-1.elb.amazonaws.com. - DomainName: example.com. - TTL: 60 - Type: CNAME - region: us-east-1 - keyid: GKTADJGHEIQSXMKKRBJ08H - key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs i ( t absolute_importt print_functiont unicode_literalsN( t SaltInvocationErrorc C@ s d t k r d St S( u) Only load if boto is available. u boto3_route53.find_hosted_zoneu boto3_route53( t __salt__t False( ( ( s= /usr/lib/python2.7/site-packages/salt/states/boto3_route53.pyt __virtual__P s c C@ s� | r | n | } i | d 6t d 6d d 6i d 6} | rP | rP t d � � n | rl | rl t d � � n | r� t | t � s� t d � � n x^ | D]S } t | t � s� t j j j | j d � | j d � f � r� t d � � q� q� Wn g } | r�x�| D]�} | j d � } | j d � } | j d � } t d d | d | d | d | d | d | � j d g � } | r�| r�g | D] } | d | k r�| ^ q�} n | s�d j | p�| | � | d <t j | d � t | d <| St | � d k r]d j | p| | d j g | D] } | d ^ q� � | d <t j | d � t | d <| S| d } | rz| d } n | s�| d } n | i | d 6| d 6g 7} qWn t } t } g } g } i | d 6| d 6| d 6| d 6| d 6| d 6} t d! | � } | s]t } t | � d k r<| d } | d } n | rH| n t t j � � } n� | d } | r�x3 | j d"