boto3_secretsmanager

Connection module for AWS Secrets Manager using boto3.

Create, inspect, and update secrets in AWS Secrets Manager. Secret values are never written to the log by this module.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

This module accepts explicit AWS 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 is available at:

https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html

If IAM roles are not used, specify credentials in the minion configuration or through a profile:

aws.keyid: GKTADJGHEIQSXMKKRBJ08H
aws.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
aws.region: us-east-1

Added in version 1.1.0.

saltext.boto3.modules.boto3_secretsmanager.__virtual__()[source]

Only load when boto3 is available.

saltext.boto3.modules.boto3_secretsmanager.get(name, version_id=None, version_stage=None, region=None, key=None, keyid=None, profile=None)[source]

Return a Secrets Manager secret value without logging its contents.

name (str):

Name or ARN of the secret.

version_id (str):

Optional version identifier to retrieve.

version_stage (str):

Optional staging label identifying the version to retrieve.

region (str):

AWS region where the secret is stored.

key (str):

AWS access key ID.

keyid (str):

AWS secret access key.

profile (str):

AWS profile to use for the connection.

CLI Example:

salt myminion boto3_secretsmanager.get name=mysecret
saltext.boto3.modules.boto3_secretsmanager.exists(name, region=None, key=None, keyid=None, profile=None)[source]

Return whether a Secrets Manager secret exists without retrieving its value.

name (str):

Name or ARN of the secret.

region (str):

AWS region where the secret is stored.

key (str):

AWS access key ID.

keyid (str):

AWS secret access key.

profile (str):

AWS profile to use for the connection.

CLI Example:

salt myminion boto3_secretsmanager.exists name=mysecret
saltext.boto3.modules.boto3_secretsmanager.create(name, secret_string, description=None, kms_key_id=None, tags=None, region=None, key=None, keyid=None, profile=None)[source]

Create a Secrets Manager secret with an initial value.

name (str):

Name of the secret.

secret_string (str):

Initial secret value. Do not include secret values in logs or state output.

description (str):

Optional description for the secret.

kms_key_id (str):

Optional KMS key ID or ARN used to encrypt the secret.

tags (dict):

Optional mapping of tag names to tag values.

region (str):

AWS region where the secret is stored.

key (str):

AWS access key ID.

keyid (str):

AWS secret access key.

profile (str):

AWS profile to use for the connection.

CLI Example:

salt myminion boto3_secretsmanager.create name=mysecret secret_string='mysecretvalue'
saltext.boto3.modules.boto3_secretsmanager.put(name, secret_string, version_stages=None, client_request_token=None, region=None, key=None, keyid=None, profile=None)[source]

Store a new value for an existing Secrets Manager secret.

name (str):

Name or ARN of the secret.

secret_string (str):

New secret value. Do not include secret values in logs or state output.

version_stages (list):

Optional staging labels to attach to the new version.

client_request_token (str):

Optional idempotency token for the request.

region (str):

AWS region where the secret is stored.

key (str):

AWS access key ID.

keyid (str):

AWS secret access key.

profile (str):

AWS profile to use for the connection.

CLI Example:

salt myminion boto3_secretsmanager.put name=mysecret secret_string='mynewsecretvalue'