Skip to content

SecretsManagerClient.get_random_password

rboto-secrets-manager==0.4.0 · Service index · Types

Model summary (excerpt): Generates a random password. We recommend that you specify the maximum length and include every character type that the system you are generating a password for can support. By default, Secrets Manager uses uppercase and lowercase letters, numbers, and the following characters in passwords: !\"#$%&'()*+,-./:; < =>?@[\]^_`{|}~ Secrets Manager generates a CloudTrail log entry when you call this...

Install and imports

python -m pip install "rboto[secrets-manager]==0.4.0"
from rboto import SecretsManagerClient
from rboto_secrets_manager.types import (
    GetRandomPasswordOutput,
)

Signature

async def get_random_password(
    *,
    password_length: int | None = None,
    exclude_characters: str | None = None,
    exclude_numbers: bool | None = None,
    exclude_punctuation: bool | None = None,
    exclude_uppercase: bool | None = None,
    exclude_lowercase: bool | None = None,
    include_space: bool | None = None,
    require_each_included_type: bool | None = None,
) -> GetRandomPasswordOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
password_length No The length of the password. If you don't include this parameter, the default length is 32 characters.
exclude_characters No A string of the characters that you don't want in the password.
exclude_numbers No Specifies whether to exclude numbers from the password. If you don't include this switch, the password can contain numbers.
exclude_punctuation No Specifies whether to exclude the following punctuation characters from the password: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ . If you don't include this switch, the password can contain punctuation.
exclude_uppercase No Specifies whether to exclude uppercase letters from the password. If you don't include this switch, the password can contain uppercase letters.
exclude_lowercase No Specifies whether to exclude lowercase letters from the password. If you don't include this switch, the password can contain lowercase letters.
include_space No Specifies whether to include the space character. If you include this switch, the password can contain space characters.
require_each_included_type No Specifies whether to include at least one upper and lowercase letter, one number, and one punctuation. If you don't include this switch, the password contains at least one of every character type.

Output

GetRandomPasswordOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
random_password str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

GetRandomPasswordOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_secrets_manager.exceptions:

InternalServiceError, InvalidParameterError, InvalidRequestError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model