Skip to main content

user_pool_domains

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

Overview

Nameuser_pool_domains
TypeResource
Idaws.cognito_idp.user_pool_domains

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
aws_account_idstringThe Amazon Web Services account that you created the user pool in. (pattern: <code>[0-9]+</code>)
cloud_front_distributionstringThe Amazon CloudFront endpoint that hosts your custom domain.
custom_domain_configobjectThe configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.
domainstringThe domain string. For custom domains, this is the fully-qualified domain name, such as auth.example.com. For Amazon Cognito prefix domains, this is the prefix alone, such as auth. (pattern: <code>^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$</code>)
managed_login_versionintegerThe version of managed login branding that you want to apply to your domain. A value of 1 indicates hosted UI (classic) branding and a version of 2 indicates managed login branding. Managed login requires that your user pool be configured for any feature plan other than Lite.
routingobjectThe routing configuration for the domain, including failover settings for multi-region deployments. Currently only Failover configurations are allowed.
s3_bucketstringThe Amazon S3 bucket where the static files for this domain are stored. (pattern: <code>^[0-9A-Za-z.-_]*(?<!.)$</code>)
statusstringThe domain status. (CREATING, DELETING, UPDATING, ACTIVE, FAILED)
user_pool_idstringThe ID of the user pool that the domain is attached to. (pattern: <code>[\w-]+_[0-9a-zA-Z]+</code>)
versionstringThe app version.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_user_pool_domainselectregionGiven a user pool domain name, returns information about the domain configuration. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints
create_user_pool_domaininsertregion, Domain, UserPoolIdA user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation creates a new user pool prefix domain or custom domain and sets the managed login branding version. Set the branding version to 1 for hosted UI (classic) or 2 for managed login. When you choose a custom domain, you must provide an SSL certificate in the US East (N. Virginia) Amazon Web Services Region in your request. Your prefix domain might take up to one minute to take effect. Your custom domain is online within five minutes, but it can take up to one hour to distribute your SSL certificate. For more information about adding a custom domain to your user pool, see Configuring a user pool domain. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints
update_user_pool_domainupdateregion, Domain, UserPoolIdA user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation updates the branding version for user pool domains between 1 for hosted UI (classic) and 2 for managed login. It also updates the SSL certificate for user pool custom domains. Changes to the domain branding version take up to one minute to take effect for a prefix domain and up to five minutes for a custom domain. This operation doesn't change the name of your user pool domain. To change your domain, delete it with DeleteUserPoolDomain and create a new domain with CreateUserPoolDomain. You can pass the ARN of a new Certificate Manager certificate in this request. Typically, ACM certificates automatically renew and you user pool can continue to use the same ARN. But if you generate a new certificate for your custom domain name, replace the original configuration with the new ARN in this request. ACM certificates for custom domains must be in the US East (N. Virginia) Amazon Web Services Region. After you submit your request, Amazon Cognito requires up to 1 hour to distribute your new certificate to your custom domain. For more information about adding a custom domain to your user pool, see Configuring a user pool domain. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints
delete_user_pool_domaindeleteregionGiven a user pool ID and domain identifier, deletes a user pool domain. After you delete a user pool domain, your managed login pages and authorization server are no longer available.

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

Given a user pool domain name, returns information about the domain configuration. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints

SELECT
aws_account_id,
cloud_front_distribution,
custom_domain_config,
domain,
managed_login_version,
routing,
s3_bucket,
status,
user_pool_id,
version
FROM aws.cognito_idp.user_pool_domains
WHERE region = '{{ region }}' -- required
;

INSERT examples

A user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation creates a new user pool prefix domain or custom domain and sets the managed login branding version. Set the branding version to 1 for hosted UI (classic) or 2 for managed login. When you choose a custom domain, you must provide an SSL certificate in the US East (N. Virginia) Amazon Web Services Region in your request. Your prefix domain might take up to one minute to take effect. Your custom domain is online within five minutes, but it can take up to one hour to distribute your SSL certificate. For more information about adding a custom domain to your user pool, see Configuring a user pool domain. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints

INSERT INTO aws.cognito_idp.user_pool_domains (
Domain,
UserPoolId,
ManagedLoginVersion,
CustomDomainConfig,
Routing,
region
)
SELECT
'{{ Domain }}' /* required */,
'{{ UserPoolId }}' /* required */,
{{ ManagedLoginVersion }},
'{{ CustomDomainConfig }}',
'{{ Routing }}',
'{{ region }}'
RETURNING
cloud_front_domain,
managed_login_version,
routing
;

UPDATE examples

A user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation updates the branding version for user pool domains between 1 for hosted UI (classic) and 2 for managed login. It also updates the SSL certificate for user pool custom domains. Changes to the domain branding version take up to one minute to take effect for a prefix domain and up to five minutes for a custom domain. This operation doesn't change the name of your user pool domain. To change your domain, delete it with DeleteUserPoolDomain and create a new domain with CreateUserPoolDomain. You can pass the ARN of a new Certificate Manager certificate in this request. Typically, ACM certificates automatically renew and you user pool can continue to use the same ARN. But if you generate a new certificate for your custom domain name, replace the original configuration with the new ARN in this request. ACM certificates for custom domains must be in the US East (N. Virginia) Amazon Web Services Region. After you submit your request, Amazon Cognito requires up to 1 hour to distribute your new certificate to your custom domain. For more information about adding a custom domain to your user pool, see Configuring a user pool domain. Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy. Learn more Signing Amazon Web Services API Requests Using the Amazon Cognito user pools API and user pool endpoints

UPDATE aws.cognito_idp.user_pool_domains
SET
Domain = '{{ Domain }}',
UserPoolId = '{{ UserPoolId }}',
ManagedLoginVersion = {{ ManagedLoginVersion }},
CustomDomainConfig = '{{ CustomDomainConfig }}',
Routing = '{{ Routing }}'
WHERE
region = '{{ region }}' --required
AND Domain = '{{ Domain }}' --required
AND UserPoolId = '{{ UserPoolId }}' --required
RETURNING
cloud_front_domain,
managed_login_version,
routing;

DELETE examples

Given a user pool ID and domain identifier, deletes a user pool domain. After you delete a user pool domain, your managed login pages and authorization server are no longer available.

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