File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto3_route53.cpython-310.pyc
Back
o ;j�� � @ s� d Z ddlZddlZddlZddlZddlZddlmZm Z e� e�Zzddl Z ddlmZ e� d��ej� dZW n eyE dZY nw dd � Zd d� Zd5dd�Zd6dd�Z d7dd�Zd8dd�Zd8dd�Z d9dd�Z d:dd�Z d;dd �Z d<d!d"�Z d<d#d$�Zd8d%d&�Z d9d'd(�Z!d)d*� Z"d+d,� Z#d-d.� Z$d/d0� Z% d=d1d2�Z& d;d3d4�Z'dS )>a� Execution module for Amazon Route53 written against Boto 3 .. versionadded:: 2017.7.0 :configuration: 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 at: .. code-block:: yaml 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 or in the minion's config file: .. code-block:: yaml route53.keyid: GKTADJGHEIQSXMKKRBJ08H route53.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A region may also be specified in the configuration: .. code-block:: yaml route53.region: us-east-1 It's also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config: .. code-block:: yaml myprofile: keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1 Note that Route53 essentially ignores all (valid) settings for 'region', since there is only one Endpoint (in us-east-1 if you care) and any (valid) region setting will just send you there. It is entirely safe to set it to None as well. :depends: boto3 � N)�CommandExecutionError�SaltInvocationError)�ClientError�boto3TFc C s t jj�� S )zg Only load if boto libraries exist and if boto libraries are greater than a given version. )�salt�utilsZversionsZcheck_boto_reqs� r r �N/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto3_route53.py�__virtual__J s r c C s t rtd td� d S d S )Nzboto3.assign_funcsZroute53)� HAS_BOTO3Z __utils__�__name__)�optsr r r �__init__R s �r �Marker� NextMarkerc C s g }|� |d�}d}|d ur�z | di |��}W n= tyT } z1|rA| j� di �� d�dkrAt�d� t�d� |d8 }W Y d } ~ q t�d | | � g W Y d } ~ S d } ~ ww |r]|� |g �n|} t| t �rj| � d d �nd |t| t�rt| n| g7 }|� |�}|�||i� |d us|S )N� � �Error�Code� Throttling�Throttled by AWS API.� � z'Could not collect results from %s(): %s�ResponseMetadatar ) �getr �response�log�debug�time�sleep�error� isinstance�dict�pop�list�update)�func�item�args�markerZ nextmarker�retr �tries�r�e�ir r r �_collect_resultsW s0 �� � �r/ r � c C s� t d|d �D ]H}t�d|� d}z|j| d�d d }W n% tyB } z|j�di ��d�d kr7t�d � n� W Y d }~nd }~ww |dkrJ dS t� |� qt� d � dS )Nr z#Getting route53 status (attempt %s)�wait��Id� ChangeInfoZStatusr r r r ZINSYNCTz,Timed out waiting for Route53 INSYNC status.F)�ranger �infoZ get_changer r r r r r r )Zchange�connr+ r Zretry�statusr- r r r �_wait_for_synco s"