Skip to content

Secrets Manager  >  Operations  >  list_secrets

list_secrets

Operation

list_secrets async

list_secrets(input: ListSecretsInput, plugins: list[Plugin] | None = None) -> 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
input ListSecretsInput

An instance of ListSecretsInput.

required
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

Returns:

Type Description
ListSecretsOutput

An instance of ListSecretsOutput.

Input

ListSecretsInput dataclass

Dataclass for ListSecretsInput structure.

Attributes

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

The filters to apply to the list of secrets.

include_planned_deletion class-attribute instance-attribute
include_planned_deletion: bool | None = 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 = 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 = 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: SortByType | None = None

If not specified, secrets are listed by CreatedDate.

sort_order class-attribute instance-attribute
sort_order: SortOrderType | None = None

Secrets are listed by CreatedDate.

Output

ListSecretsOutput dataclass

Dataclass for ListSecretsOutput structure.

Attributes

next_token class-attribute instance-attribute
next_token: str | None = 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.

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

A list of the secrets in the account.