File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto_rds.cpython-310.pyc
Back
o ;j� � @ s\ d Z ddlZddlZddlmZ ddlZddlZddlm Z e� e�Zz$ddl Z ddlZddlmZ e� d��ej� e� d��ej� dZW n eyR d ZY nw i d def�dd ef�ddef�ddef�ddef�ddef�ddef�ddef�ddef�ddef�ddef�d d!ef�d"d#ef�d$d%ef�d&d'ef�d(d)ef�d*d+ef�i d,d-ef�d.d/ef�d0d1ef�d2d3ef�d4d5ef�d6d7ef�d8d9ef�d:d;ef�d<d=ef�d>d?ef�d@dAef�dBdCef�dDdEef�dFdGef�dHdIef�dJdKef�dLdMef��dNefdOefdPefdQefdRefdSefdTefdUefdV��ZdWdX� ZdYdZ� Zd�d[d\�Z d�d]d^�Z d�d_d`�Z d�dadb�Z d�dcdd�Z d�dedf�Z! d�dgdh�Z" d�didj�Z# d�dkdl�Z$ m d�dndo�Z%d�dpdq�Z& r d�dsdt�Z' u d�dvdw�Z(d�dxdy�Z) zd�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��Z0d�d�� Z1dS )�a� Connection module for Amazon RDS .. versionadded:: 2015.8.0 :configuration: This module accepts explicit rds 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 rds.keyid: GKTADJGHEIQSXMKKRBJ08H rds.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs A region may also be specified in the configuration: .. code-block:: yaml rds.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: boto3 � N)�OrderedDict)�SaltInvocationError)�ClientError�boto�boto3TF�allocated_storage�AllocatedStorage�allow_major_version_upgradeZAllowMajorVersionUpgrade�apply_immediatelyZApplyImmediately�auto_minor_version_upgrade�AutoMinorVersionUpgrade�availability_zone�AvailabilityZone�backup_retention_period�BackupRetentionPeriod�ca_certificate_identifier�CACertificateIdentifier�character_set_name�CharacterSetName�copy_tags_to_snapshot�CopyTagsToSnapshot�db_cluster_identifier�DBClusterIdentifier�db_instance_class�DBInstanceClass�db_name�DBName�db_parameter_group_name�DBParameterGroupName�db_port_numberZDBPortNumber�db_security_groupsZDBSecurityGroups�db_subnet_group_name�DBSubnetGroupName�domainZDomain�domain_iam_role_nameZDomainIAMRoleName�engine�Engine�engine_version� EngineVersion�iops�Iops� kms_key_id�KmsKeyId� license_model�LicenseModel�master_user_passwordZMasterUserPassword�master_usernameZMasterUsername�monitoring_interval�MonitoringInterval�monitoring_role_arn�MonitoringRoleArn�multi_azZMultiAZ�name�DBInstanceIdentifier�new_db_instance_identifierZNewDBInstanceIdentifier�option_group_name�OptionGroupName�port�Port�preferred_backup_window�PreferredBackupWindow�preferred_maintenance_window�PreferredMaintenanceWindow� PromotionTier�PubliclyAccessible�StorageEncrypted�StorageType�Tags�TdeCredentialArnZTdeCredentialPasswordZVpcSecurityGroupIds)�promotion_tier�publicly_accessible�storage_encrypted�storage_type�tags�tde_credential_arn�tde_credential_password�vpc_security_group_idsc C s t jjjdd�S )zg Only load if boto libraries exist and if boto libraries are greater than a given version. z1.3.1)Z boto3_ver)�salt�utilsZversionsZcheck_boto_reqs� rQ rQ �I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_rds.py�__virtual__{ s rS c C s t rtd td� d S d S )Nzboto3.assign_funcs�rds)�HAS_BOTO� __utils__�__name__)�optsrQ rQ rR �__init__� s �rY c C �` t ||||d�}z |j| d�}dt|�iW S ty/ } zdtd |�iW Y d}~S d}~ww )z� Check to see if an RDS exists. CLI Example: .. code-block:: bash salt myminion boto_rds.exists myrds region=us-east-1 ��region�key�keyid�profile�r7 �exists�error�boto3.get_errorN)� _get_conn�describe_db_instances�boolr rV � r6 rK r\ r] r^ r_ �connrT �erQ rQ rR ra � s ��ra c C rZ )z� Check to see if an RDS option group exists. CLI Example: .. code-block:: bash salt myminion boto_rds.option_group_exists myoptiongr region=us-east-1 r[ �r: ra rb rc N)rd Zdescribe_option_groupsrf r rV rg rQ rQ rR �option_group_exists� s ��rk c C s� t ||||d�}z|j| d�}t|�dd�W S tyA } zi } |jd d dkr-d| d <