HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/boto_ssm.cpython-310.pyc
o

�N�g��@sxdZddlZddlmmZddlZe�e�Z	dd�Z
						d
dd�Z									dd	d
�Zddd�Z
dS)a�
Connection module for Amazon SSM

:configuration: This module uses 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

:depends: boto3
�NcCs&tjj��}|durtdtd�|S)z,
    Only load if boto libraries exist.
    Tzboto3.assign_funcs�ssm)�salt�utilsZversionsZcheck_boto_reqs�	__utils__�__name__)Z
has_boto_reqs�r�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/boto_ssm.py�__virtual__sr	Fc	Csptdd||||d�}z	|j||d�}Wn|jjy&t�d|�YdSw|r2t�|dd�S|ddS)	z�
    Retrieves a parameter from SSM Parameter Store

    .. versionadded:: 3000

    .. code-block:: text

        salt-call boto_ssm.get_parameter test-param withdescription=True
    �boto3.get_connectionr��region�key�keyid�profile)�NameZWithDecryptionz(get_parameter: Unable to locate name: %sFZ	Parameter�Value)r�
get_parameter�
exceptions�ParameterNotFound�log�warning�json�loads)	�nameZwithdecryptionZ	resp_jsonrr
rr�conn�resprrrr"s
��r�StringcCs�tdd|||	|
d�}|dvrtd��|dkr|std��i}|r%||d<|r+||d	<|r1||d
<z|jd||||d�|��}
W|
dS|jjyTt�d�Yd
Sw)z�
    Sets a parameter in the SSM parameter store

    .. versionadded:: 3000

    .. code-block:: text

        salt-call boto_ssm.put_parameter test-param test_value Type=SecureString KeyId=alias/aws/ssm Description='test encrypted key'
    r
rr)rZ
StringList�SecureStringz/Type needs to be String|StringList|SecureStringrzRequire KeyId with SecureString�Description�KeyId�AllowedPattern)rr�Type�	OverwritezfThe parameter already exists. To overwrite this value, set the Overwrite option in the request to TrueFZVersionNr)r�AssertionError�
put_parameterrZParameterAlreadyExistsrr)rrrr!rr"r rr
rrrZ	boto_argsrrrrr$Cs6
���	���r$cCsdtdd||||d�}z|j|d�}Wn|jjy%t�d|�YdSw|ddd	kr0d
SdS)z�
    Removes a parameter from the SSM parameter store

    .. versionadded:: 3000

    .. code-block:: text

        salt-call boto_ssm.delete_parameter test-param
    r
rr)rz+delete_parameter: Unable to locate name: %sFZResponseMetadataZHTTPStatusCode��T)r�delete_parameterrrrr)rrr
rrrrrrrr&vs

��r&)FFNNNN)	NrNFNNNNN)NNNN)�__doc__�loggingZsalt.utils.jsonrrZsalt.utils.versionsr�	getLoggerrrr	rr$r&rrrr�<module>s0

�$
�3