list_secrets
async
¶
list_secrets(
*,
config_overrides: Optional[AsyncSecretsManagerClientConfig] = None,
include_planned_deletion: Optional[BooleanType] = None,
max_results: Optional[MaxResultsType] = None,
next_token: Optional[NextTokenType] = None,
filters: Optional[FiltersListType] = None,
sort_order: Optional[SortOrderType] = None,
sort_by: Optional[SortByType] = None,
) -> ListSecretsResponse
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:
-
include_planned_deletion(Optional[BooleanType], default:None) –Specifies whether to include secrets scheduled for deletion. By default, secrets scheduled for deletion aren't included.
-
max_results(Optional[MaxResultsType], default: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, callListSecretsagain with the value fromNextToken. -
next_token(Optional[NextTokenType], default: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
ListSecretsagain with this value. -
filters(Optional[FiltersListType], default:None) –The filters to apply to the list of secrets.
-
sort_order(Optional[SortOrderType], default:None) –Secrets are listed by
CreatedDate. -
sort_by(Optional[SortByType], default:None) –If not specified, secrets are listed by
CreatedDate.
Raises:
-
InternalServiceError–An error occurred on the server side.
-
InvalidNextTokenException–The
NextTokenvalue is invalid. -
InvalidParameterException–The parameter name or value is invalid.
-
InvalidRequestException–A parameter value is not valid for the current state of the resource.
Possible causes:
-
The secret is scheduled for deletion.
-
You tried to enable rotation on a secret that doesn't already have a Lambda function ARN configured and you didn't include such an ARN as a parameter in this call.
-
The secret is managed by another service, and you must use that service to update it. For more information, see Secrets managed by other Amazon Web Services services.
-
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list the secrets in your account The following example shows how to list all of the secrets in your account.
Source code in docs_src/capo_secrets_manager/_services/async_secrets_manager.py
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 | |