Skip to content

list_secrets

Operation

list_secrets

list_secrets(request: ListSecretsInput | ListSecretsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[ListSecretsInputDict]) -> ListSecretsOutput

Lists the secrets that are stored by Secrets Manager in the Amazon Web Services account, not including secrets that are marked for deletion. To see secrets marked for deletion, use the Secrets Manager console.

All Secrets Manager operations are eventually consistent. ListSecrets might not reflect changes from the last five minutes. You can get more recent information for a specific secret by calling DescribeSecret.

To list the versions of a secret, use ListSecretVersionIds.

To retrieve the values for the secrets, call BatchGetSecretValue or GetSecretValue.

For information about finding secrets in the console, see Find secrets in Secrets Manager.

Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.

Required permissions: secretsmanager:ListSecrets. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

Parameters:

Name Type Description Default
request ListSecretsInput | ListSecretsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[ListSecretsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
ListSecretsOutput

An instance of ListSecretsOutput.

list_secrets async

list_secrets(request: ListSecretsInput | ListSecretsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[ListSecretsInputDict]) -> ListSecretsOutput

Lists the secrets that are stored by Secrets Manager in the Amazon Web Services account, not including secrets that are marked for deletion. To see secrets marked for deletion, use the Secrets Manager console.

All Secrets Manager operations are eventually consistent. ListSecrets might not reflect changes from the last five minutes. You can get more recent information for a specific secret by calling DescribeSecret.

To list the versions of a secret, use ListSecretVersionIds.

To retrieve the values for the secrets, call BatchGetSecretValue or GetSecretValue.

For information about finding secrets in the console, see Find secrets in Secrets Manager.

Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.

Required permissions: secretsmanager:ListSecrets. For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets Manager.

Parameters:

Name Type Description Default
request ListSecretsInput | ListSecretsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[ListSecretsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
ListSecretsOutput

An instance of ListSecretsOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

ListSecretsInputDict

Bases: TypedDict

Dictionary form of ListSecretsInput.

Attributes

filters instance-attribute
filters: Sequence[Filter | FilterDict] | None

The filters to apply to the list of secrets.

include_planned_deletion instance-attribute
include_planned_deletion: bool | None

Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.

max_results instance-attribute
max_results: int | None

The number of results to include in the response.

If there are more results available, in the response, Secrets Manager includes NextToken. To get the next results, call ListSecrets again with the value from NextToken.

next_token instance-attribute
next_token: str | None

A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call ListSecrets again with this value.

sort_by instance-attribute
sort_by: str | None

If not specified, secrets are listed by CreatedDate.

sort_order instance-attribute
sort_order: str | None

Secrets are listed by CreatedDate.

ListSecretsInput dataclass

Bases: _SerdeShape

Dataclass for ListSecretsInput structure.

Attributes

filters class-attribute instance-attribute
filters: list[Filter] | None = ...

The filters to apply to the list of secrets.

include_planned_deletion class-attribute instance-attribute
include_planned_deletion: bool | None = ...

Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.

max_results class-attribute instance-attribute
max_results: int | None = ...

The number of results to include in the response.

If there are more results available, in the response, Secrets Manager includes NextToken. To get the next results, call ListSecrets again with the value from NextToken.

next_token class-attribute instance-attribute
next_token: str | None = ...

A token that indicates where the output should continue from, if a previous call did not show all results. To get the next results, call ListSecrets again with this value.

sort_by class-attribute instance-attribute
sort_by: str | None = ...

If not specified, secrets are listed by CreatedDate.

sort_order class-attribute instance-attribute
sort_order: str | None = ...

Secrets are listed by CreatedDate.

Output

ListSecretsOutput dataclass

Bases: _SerdeShape

Dataclass for ListSecretsOutput structure.

Attributes

next_token class-attribute instance-attribute
next_token: str | None = ...

Secrets Manager includes this value if there's more output available than what is included in the current response. This can occur even when the response includes no values at all, such as when you ask for a filtered view of a long list. To get the next results, call ListSecrets again with this value.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

secret_list class-attribute instance-attribute
secret_list: list[SecretListEntry] | None = ...

A list of the secrets in the account.