File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/boto_rds.cpython-310.pyc
o
�N�gg � @ s d Z ddlZddlZddlZddlmZ e�e�Z dd� Z
ddd�Z ddd �Z dd
d�Z
ddd�Z ddd�Z ddd�ZdS )a�
Manage RDSs
===========
.. versionadded:: 2015.8.0
Create and destroy RDS instances. Be aware that this interacts with Amazon's
services, and so may incur charges.
This module uses ``boto``, which can be installed via package, or pip.
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 `here
<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 file or
in the minion's config file:
.. code-block:: yaml
rds.keyid: GKTADJGHEIQSXMKKRBJ08H
rds.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
It's also possible to specify ``key``, ``keyid`` and ``region`` via a profile,
either passed in as a dict, or as a string to pull from pillars or minion
config:
.. code-block:: yaml
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
.. code-block:: yaml
Ensure myrds RDS exists:
boto_rds.present:
- name: myrds
- allocated_storage: 5
- storage_type: standard
- db_instance_class: db.t2.micro
- engine: MySQL
- master_username: myuser
- master_user_password: mypass
- region: us-east-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
- tags:
key: value
.. code-block:: yaml
Ensure parameter group exists:
create-parameter-group:
boto_rds.parameter_present:
- name: myparametergroup
- db_parameter_group_family: mysql5.6
- description: "parameter group family"
- parameters:
- binlog_cache_size: 32768
- binlog_checksum: CRC32
- region: eu-west-1
:depends: boto3
� N)�SaltInvocationErrorc C s dt v rdS dt �d�fS )z)
Only load if boto is available.
�boto_rds.existsZboto_rdsF)�__salt__Zmissing_fun_string� r r �H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/boto_rds.py�__virtual__P s r c+ - C s� | ddi d�}+t d | | |"|$|%|*�},|,�d�s�td r)d| � d�|+d <