Skip to main content

user_pool_client_secrets

Creates, updates, deletes, gets or lists a user_pool_client_secrets resource.

Overview

Nameuser_pool_client_secrets
TypeResource
Idaws.cognito_idp.user_pool_client_secrets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
client_secretsarrayA list of client secret descriptors containing the identifier and creation date for each secret. For security reasons, the response never reveals the actual secret value in ClientSecretValue.
next_tokenstringThe identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. (pattern: <code>[\S]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_user_pool_client_secretsselectregionLists all client secrets associated with a user pool app client. Returns metadata about the secrets. The response does not include pagination tokens as there are only 2 secrets at any given time and we return both with every ListUserPoolClientSecrets call. For security reasons, the response never reveals the actual secret value in ClientSecretValue.
add_user_pool_client_secretupdateregion, UserPoolId, ClientIdCreates a new client secret for an existing confidential user pool app client. Supports up to 2 active secrets per app client for zero-downtime credential rotation workflows.
delete_user_pool_client_secretdeleteregionDeletes a specific client secret from a user pool app client. You cannot delete the last remaining secret for an app client.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Lists all client secrets associated with a user pool app client. Returns metadata about the secrets. The response does not include pagination tokens as there are only 2 secrets at any given time and we return both with every ListUserPoolClientSecrets call. For security reasons, the response never reveals the actual secret value in ClientSecretValue.

SELECT
client_secrets,
next_token
FROM aws.cognito_idp.user_pool_client_secrets
WHERE region = '{{ region }}' -- required
;

UPDATE examples

Creates a new client secret for an existing confidential user pool app client. Supports up to 2 active secrets per app client for zero-downtime credential rotation workflows.

UPDATE aws.cognito_idp.user_pool_client_secrets
SET
UserPoolId = '{{ UserPoolId }}',
ClientId = '{{ ClientId }}',
ClientSecret = '{{ ClientSecret }}'
WHERE
region = '{{ region }}' --required
AND UserPoolId = '{{ UserPoolId }}' --required
AND ClientId = '{{ ClientId }}' --required
RETURNING
client_secret_descriptor;

DELETE examples

Deletes a specific client secret from a user pool app client. You cannot delete the last remaining secret for an app client.

DELETE FROM aws.cognito_idp.user_pool_client_secrets
WHERE region = '{{ region }}' --required
;