module documentation

Fetchers that retrieve secret values from AWS Secrets Manager.

Fetchers are synchronous and called from a worker thread, so that the cache that uses them isn't bound to any event loop.

Class Fetcher Fetches secret values by ID. Must be safe to call from multiple threads.
Class LambdaExtensionFetcher Fetches secrets through the AWS Parameters and Secrets Lambda Extension. See https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_lambda.html.
Class SDKFetcher Fetches secrets directly from Secrets Manager. If no client is given, one is created from the default AWS config on first use.
Class SecretValue A fetched secret value.
Function boto3_available Whether boto3 can be imported.
Function new_default_fetcher Return a fetcher for the Lambda extension if it is detected, and otherwise an SDK fetcher with a client created from the default AWS config.
Constant ENV_LAMBDA_EXTENSION_PORT Undocumented
Constant FETCH_TIMEOUT_SECONDS Undocumented
Function _new_secret_value Undocumented
Constant _DEFAULT_LAMBDA_EXTENSION_PORT Undocumented
Constant _ENV_AWS_SESSION_TOKEN Undocumented
Constant _ENV_LAMBDA_FUNCTION_NAME Undocumented
Constant _LAMBDA_EXTENSION_HOST Undocumented
Constant _LAMBDA_EXTENSION_PROBE_TIMEOUT_SECONDS Undocumented
Constant _LAMBDA_EXTENSION_TOKEN_HEADER Undocumented
def boto3_available() -> bool: (source)

Whether boto3 can be imported.

def new_default_fetcher() -> Fetcher: (source)

Return a fetcher for the Lambda extension if it is detected, and otherwise an SDK fetcher with a client created from the default AWS config.

The extension doesn't set PARAMETERS_SECRETS_EXTENSION_HTTP_PORT in the function's environment unless the user configured it, so if it is unset and running in Lambda, the extension's default port is probed. Setting it to empty disables detection, for when another service uses the default port.

ENV_LAMBDA_EXTENSION_PORT: str = (source)

Undocumented

Value
'PARAMETERS_SECRETS_EXTENSION_HTTP_PORT'
FETCH_TIMEOUT_SECONDS: float = (source)

Undocumented

Value
10.0
def _new_secret_value(secret_string: str | None, secret_binary: bytes | None, version_id: str | None) -> SecretValue: (source)

Undocumented

_DEFAULT_LAMBDA_EXTENSION_PORT: str = (source)

Undocumented

Value
'2773'
_ENV_AWS_SESSION_TOKEN: str = (source)

Undocumented

Value
'AWS_SESSION_TOKEN'
_ENV_LAMBDA_FUNCTION_NAME: str = (source)

Undocumented

Value
'AWS_LAMBDA_FUNCTION_NAME'
_LAMBDA_EXTENSION_HOST: str = (source)

Undocumented

Value
'localhost'
_LAMBDA_EXTENSION_PROBE_TIMEOUT_SECONDS: float = (source)

Undocumented

Value
1.0
_LAMBDA_EXTENSION_TOKEN_HEADER: str = (source)

Undocumented

Value
'X-Aws-Parameters-Secrets-Token'