%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/boto_cloudfront.pyo

�
���^c@@skdZddlmZmZmZddlZddlZeje�Z	d�Z
ddddd�ZdS(u
Manage CloudFront distributions

.. versionadded:: 2018.3.0

Create, update and destroy CloudFront distributions.

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
<https://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

    cloudfront.keyid: GKTADJGHEIQSXMKKRBJ08H
    cloudfront.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

It's also possible to specify ``key``, ``keyid``, and ``region`` via a profile,
either passed in as a dict, or a string to pull from pillars or minion config:

.. code-block:: yaml

    myprofile:
        keyid: GKTADJGHEIQSXMKKRBJ08H
        key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
        region: us-east-1

.. code-block:: yaml

    aws:
        region:
            us-east-1:
                profile:
                    keyid: GKTADJGHEIQSXMKKRBJ08H
                    key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
                    region: us-east-1

:depends: boto3
i(tabsolute_importtprint_functiontunicode_literalsNcC@s)dtkr%d}t|jd�fSdS(u)
    Only load if boto is available.
    u boto_cloudfront.get_distributionu9The boto_cloudfront state module could not be loaded: {}.u(boto_cloudfront exec module unavailable.uboto_cloudfront(t__salt__tFalsetformat(tmsg((s?/usr/lib/python2.7/site-packages/salt/states/boto_cloudfront.pyt__virtual__7sc
C@si|d6dd6id6}td|d|d|d|d	|�}d
|krwt|d<dj||d
�|d<|S|d}	|	d!krktd
r�d!|d<dj|�|d<id!d6|d6|d<|Std|||d|d|d|d	|�}d
|kr2t|d<dj||d
�|d<|St|d<dj|�|d<id!d6|d6|d<|Si|	ddd6|	dd6}
i|d6|d6}td|
|�}d�}
djtj	|
|
�j
t�|
|�j
t���}td|kpd|k�}|s9t|d<dj|�|d<|Std
r�d!|d<djdj|�|g�|d<i|d6|d<|Std|||d|d|d|d	|�}d
|kr�t|d<dj||d
�|d<|St|d<d j|�|d<i|d6|d<|Sd!S("uy
    Ensure the CloudFront distribution is present.

    name (string)
        Name of the CloudFront distribution

    config (dict)
        Configuration for the distribution

    tags (dict)
        Tags to associate with the distribution

    region (string)
        Region to connect to

    key (string)
        Secret key to use

    keyid (string)
        Access key to use

    profile (dict or string)
        A dict with region, key, and keyid,
        or a pillar key (string) that contains such a dict.

    Example:

    .. code-block:: yaml

        Manage my_distribution CloudFront distribution:
            boto_cloudfront.present:
              - name: my_distribution
              - config:
                  Comment: 'partial config shown, most parameters elided'
                  Enabled: True
              - tags:
                  testing_key: testing_value
    unameuucommentuchangesu boto_cloudfront.get_distributiontregiontkeytkeyidtprofileuerroruresultu$Error checking distribution {0}: {1}utestu"Distribution {0} set for creation.uoldunewu#boto_cloudfront.create_distributionu$Error creating distribution {0}: {1}uCreated distribution {0}.udistributionuDistributionConfiguconfigutagsudictdiffer.deep_diffcS@s0d}td|�}td|dtd|�S(uF
            Safely dump YAML using a readable flow style
            uIndentedSafeOrderedDumperuyaml.get_dumperu	yaml.dumptdefault_flow_styletDumper(t	__utils__R(tattrstdumper_nametdumper((s?/usr/lib/python2.7/site-packages/salt/states/boto_cloudfront.pyt_yaml_safe_dump�su$Distribution {0} has correct config.u
u$Distribution {0} set for new config:udiffu#boto_cloudfront.update_distributionu$Error updating distribution {0}: {1}uUpdated distribution {0}.N(RRRtNonet__opts__tTrueRtjointdifflibtunified_difft
splitlinestbool(tnametconfigttagsRR	R
Rtrettrestoldtfull_config_oldtfull_config_newt
diffed_configRtchanges_difftany_changes((s?/usr/lib/python2.7/site-packages/salt/states/boto_cloudfront.pytpresentAs�/
	



	


		



	

(
t__doc__t
__future__RRRRtloggingt	getLoggert__name__tlogRRR&(((s?/usr/lib/python2.7/site-packages/salt/states/boto_cloudfront.pyt<module>-s	

Zerion Mini Shell 1.0