airflow.providers.amazon.aws.hooks.secrets_manager

Classes

SecretsManagerHook

Interact with Amazon SecretsManager Service.

Module Contents

class airflow.providers.amazon.aws.hooks.secrets_manager.SecretsManagerHook(*args, **kwargs)[source]

Bases: airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook

Interact with Amazon SecretsManager Service.

Provide thin wrapper around boto3.client("secretsmanager").

Additional arguments (such as aws_conn_id) may be specified and are passed down to the underlying AwsBaseHook.

get_secret(secret_name)[source]

Retrieve secret value from AWS Secrets Manager as a str or bytes.

The value reflects format it stored in the AWS Secrets Manager.

Parameters:

secret_name (str) – name of the secrets.

Returns:

Union[str, bytes] with the information about the secrets

Return type:

str | bytes

get_secret_as_dict(secret_name)[source]

Retrieve secret value from AWS Secrets Manager as a dict.

Parameters:

secret_name (str) – name of the secrets.

Returns:

dict with the information about the secrets

Return type:

dict

Was this entry helpful?