File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/boto_kms.cpython-310.pyc
o
�N�gR0 � @ st d Z ddlm mZ ddlmZ dd� Z ddd �Zd
d� Zdd
� Z dd� Z
dd� Zdd� ZdS )a�
Manage KMS keys, key policies and grants.
.. versionadded:: 2015.8.0
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 kms 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
elb.keyid: GKTADJGHEIQSXMKKRBJ08H
elb.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 mykey key exists:
boto_kms.key_present:
- name: mykey
- region: us-east-1
# Using a profile from pillars
Ensure mykey key exists:
boto_kms.key_present:
- name: mykey
- region: us-east-1
- profile: myprofile
# Passing in a profile
Ensure mykey key exists:
boto_key.key_present:
- name: mykey
- region: us-east-1
- profile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
� N)�SaltInvocationErrorc C s dt v rdS dS )z)
Only load if boto is available.
�boto_kms.describe_keyZboto_kms)Fz#boto_kms module could not be loaded)�__salt__� r r �H/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/boto_kms.py�__virtual__? s r FTc C s� |st d��|rt|t�st d��t|t�st d��t|t�s#t d��t|t�s,t d��| ddi d�}t| ||||||| |
|�
}
t�|d |
d �|d <