File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto_elb.cpython-310.pyc
Back
o ;j� � @ s d Z ddlZddlZddlmZ ddlZddlZz'ddlZddl Zddl mZ ddlm Z mZmZmZ e�d��ej� dZW n eyJ dZY nw e�e�Zd d � ZdLdd�ZdLd d�ZdLdd�ZdLdd�Zdd� Z dMdd�ZdLdd�ZdLdd�Z dLdd�Z! dLdd�Z" dLd d!�Z# dLd"d#�Z$dLd$d%�Z%dLd&d'�Z&dLd(d)�Z'dLd*d+�Z(dLd,d-�Z) dLd.d/�Z* dLd0d1�Z+ dLd2d3�Z, dNd4d5�Z- dOd6d7�Z. dLd8d9�Z/dLd:d;�Z0 dOd<d=�Z1 dOd>d?�Z2dLd@dA�Z3dLdBdC�Z4dDdE� Z5dPdFdG�Z6dHdI� Z7dJdK� Z8dS )Qa� Connection module for Amazon ELB .. versionadded:: 2014.7.0 :configuration: This module accepts explicit elb 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:: text 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 elb.keyid: GKTADJGHEIQSXMKKRBJ08H elb.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A region may also be specified in the configuration: .. code-block:: yaml elb.region: us-east-1 If a region is not specified, the default is 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 :depends: boto >= 2.33.0 � N)�OrderedDict)�HealthCheck)�AccessLogAttribute�ConnectionDrainingAttribute�ConnectionSettingAttribute�CrossZoneLoadBalancingAttribute�botoTFc C s2 t jjjddd�} | du rtd tddtd� | S ) z, Only load if boto libraries exist. z2.33.0F)Zboto_verZcheck_boto3Tzboto.assign_funcs�elbzec2.elb)�module�pack)�salt�utilsZversionsZcheck_boto_reqs� __utils__�__name__Z__salt__)Z has_boto_reqs� r �I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_elb.py�__virtual__I s �r c C sp t ||||d�}z|j| gd�}|rW dS t�d|� W dS tjjy7 } zt�|� W Y d}~dS d}~ww )z� Check to see if an ELB exists. CLI Example: .. code-block:: bash salt myminion boto_elb.exists myelb region=us-east-1 ��region�key�keyid�profile��load_balancer_namesTz-The load balancer does not exist in region %sFN)� _get_conn�get_all_load_balancers�log�debugr � exception�BotoServerError�warning)�namer r r r �connr �errorr r r �existsV s ��r$ c C s\ t | |||d�}z dd� |�� D �W S tjjy- } z t�|� g W Y d}~S d}~ww )z� Return all load balancers associated with an account CLI Example: .. code-block:: bash salt myminion boto_elb.get_all_elbs region=us-east-1 r c S s g | ]}|�qS r r ��.0�er r r � <listcomp>{ s z get_all_elbs.<locals>.<listcomp>N)r r r r r r r )r r r r r"