File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/__pycache__/ec2.cpython-310.pyc
o
�N�g,q � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlZddlZddl
ZddlZddlm mZ ddlmZ ddlmZ ddlZddlm mZ ddlZddlZddlZddl Zddl!m m"Z" ddl#Zddl$Zddl%Zddl&Zddl'm(Z(m)Z)m*Z*m+Z+m,Z, zddl-Z-dZ.W n e/y� dZ.Y nw e�0e1�Z2ddd d
ddd
ddddd�Z3dZ4dZ5g d�Z6e
�7de
j8�Z9dZ:dd� Z;dd� Z<dd� Z=dd� Z>d d!� Z?d"d#� Z@d$d%� ZA d�d&d'�ZB ( ) * +d�d,d-�ZCd�d.d/�ZDd�d0d1�ZEd2d3� ZFd4d5� ZGd6d7� ZHd8d9� ZId:d;� ZJd<d=� ZKd�d>d?�ZLd�d@dA�ZMdBdC� ZNdDdE� ZOdFdG� ZPdHdI� ZQdJdK� ZRdLdM� ZSdNdO� ZTdPdQ� ZUdRdS� ZVd�dTdU�ZWd�dVdW�ZXdXdY� ZYdZd[� ZZd\d]� Z[d^d_� Z\d`da� Z]dbdc� Z^d�ddde�Z_d�dfdg�Z`d�dhdi�Zadjdk� Zbd�dldm�Zcd�dndo�Zd d�dpdq�Zedrds� Zfd�dtdu�Zgdvdw� Zhd�dxdy�Zid�dzd{�Zjd�d|d}�Zk d�d~d�Zl d�d�d��Zm d�d�d��Znd�d�d��Zod�d�d��Zpd�d�d��Zqd�d�d��Zrd�d�d��Zsd�d�d��Ztd�d�d��Zud�d�� Zvd�d�� Zwd�d�d��Zxd�d�d��Zyd�d�d��Zzd�d�d��Z{d�d�d��Z|d�d�d��Z}d�d�� Z~d�d�d��Zd�d�d��Z�d�d�d��Z�d�d�d��Z�d�d�d��Z�d�d�d��Z�d�d�d��Z� d�d�d��Z�d�d�d��Z�d�d�� Z�d�d�� Z�d�d�d��Z�d�d�� Z�d�d�d��Z�d�d�d��Z�d�d�dÄZ�d�d�dńZ�d�dDŽ Z�d�d�dɄZ�d�d�d˄Z�d�d�d̈́Z�d�d�dτZ�d�d�dфZ�d�d�dӄZ�d�d�dՄZ�d�d�dׄZ�d�d�dلZ� d�d�dۄZ� d�d�d݄Z�d�d�d߄Z�d�d� Z�d�d�d�Z�d�d�d�Z�d�d�d�Z�dS )�a�
The EC2 Cloud Module
====================
The EC2 cloud module is used to interact with the Amazon Elastic Compute Cloud.
To use the EC2 cloud module, set up the cloud configuration at
``/etc/salt/cloud.providers`` or ``/etc/salt/cloud.providers.d/ec2.conf``:
.. code-block:: yaml
my-ec2-config:
# EC2 API credentials: Access Key ID and Secret Access Key.
# Alternatively, to use IAM Instance Role credentials available via
# EC2 metadata set both id and key to 'use-instance-role-credentials'
id: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
# If 'role_arn' is specified the above credentials are used to
# to assume to the role. By default, role_arn is set to None.
role_arn: arn:aws:iam::012345678910:role/SomeRoleName
# The ssh keyname to use
keyname: default
# The amazon security group
securitygroup: ssh_open
# The location of the private key which corresponds to the keyname
private_key: /root/default.pem
# Be default, service_url is set to amazonaws.com. If you are using this
# driver for something other than Amazon EC2, change it here:
service_url: amazonaws.com
# The endpoint that is ultimately used is usually formed using the region
# and the service_url. If you would like to override that entirely, you
# can explicitly define the endpoint:
endpoint: myendpoint.example.com:1138/services/Cloud
# SSH Gateways can be used with this provider. Gateways can be used
# when a salt-master is not on the same private network as the instance
# that is being deployed.
# Defaults to None
# Required
ssh_gateway: gateway.example.com
# Defaults to port 22
# Optional
ssh_gateway_port: 22
# Defaults to root
# Optional
ssh_gateway_username: root
# Default to nc -q0 %h %p
# Optional
ssh_gateway_command: "-W %h:%p"
# One authentication method is required. If both
# are specified, Private key wins.
# Private key defaults to None
ssh_gateway_private_key: /path/to/key.pem
# Password defaults to None
ssh_gateway_password: ExamplePasswordHere
driver: ec2
# Pass userdata to the instance to be created
userdata_file: /etc/salt/my-userdata-file
# Instance termination protection setting
# Default is disabled
termination_protection: False
:depends: requests
� N)�
cmp_to_key)�SaltCloudConfigError�SaltCloudException�SaltCloudExecutionFailure�SaltCloudExecutionTimeout�SaltCloudSystemExitTFZec2_ap_northeastZec2_ap_northeast_2Zec2_ap_southeastZec2_ap_southeast_2Zec2_eu_westZec2_eu_centralZec2_sa_eastZec2_us_eastZec2_us_gov_west_1Zec2_us_westZec2_us_west_oregon)zap-northeast-1zap-northeast-2zap-southeast-1zap-southeast-2z eu-west-1zeu-central-1z sa-east-1� us-east-1z
us-gov-west-1z us-west-1z us-west-2r z
2016-11-15)ZRequestLimitExceededZInsufficientInstanceCapacityZ
InternalErrorZUnavailableZInsufficientAddressCapacityZ$InsufficientReservedInstanceCapacityz /\*.*?\*/�ec2c C s t � du rdS t� du rdS tS )zH
Set up the libcloud functions and check for EC2 configurations
F)�get_configured_provider�get_dependencies�__virtualname__� r
r
�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/cloud/clouds/ec2.py�__virtual__� s
r c C s"