A user pool domain hosts managed login, an authorization server and web server for authentication in your application¶
Description¶
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
Usage¶
cognitoidentityprovider_create_user_pool_domain(Domain, UserPoolId,
ManagedLoginVersion, CustomDomainConfig, Routing)
Arguments¶
-
Domain[required] The domain string. For custom domains, this is the fully-qualified domain name, such as
auth.example.com. For prefix domains, this is the prefix alone, such asmyprefix. A prefix value ofmyprefixfor a user pool in theus-east-1Region results in a domain ofmyprefix.auth.us-east-1.amazoncognito.com. -
UserPoolId[required] The ID of the user pool where you want to add a domain.
-
ManagedLoginVersionThe version of managed login branding that you want to apply to your domain. A value of
1indicates hosted UI (classic) and a version of2indicates managed login.Managed login requires that your user pool be configured for any feature plan other than
Lite.A
ManagedLoginVersionvalue of2does not activate managed login pages for your app client. When you create an app client programmatically, your app client has no branding style. To use managed login, create a branding style using thecreate_managed_login_brandingoperation. When you use the console, Amazon Cognito assigns a default branding style automatically. When you use the API or an SDK, you must create a branding style yourself. -
CustomDomainConfigThe configuration for a custom domain. Configures your domain with an Certificate Manager certificate in the
us-east-1Region.Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can omit this parameter and use a prefix domain instead.
When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain.
-
RoutingThe configuration of routing for requests to the domain for replicas of a replicated user pool. The routing configuration is currently only supported for custom domains.
Value¶
A list with the following syntax:
list(
ManagedLoginVersion = 123,
CloudFrontDomain = "string",
Routing = list(
Failover = list(
SecondaryRegion = "string",
PrimaryRoute53HealthCheckId = "string"
)
)
)
Request syntax¶
svc$create_user_pool_domain(
Domain = "string",
UserPoolId = "string",
ManagedLoginVersion = 123,
CustomDomainConfig = list(
CertificateArn = "string",
SecurityPolicy = "TLS_V1"|"TLS_V1_2_2021"|"TLS_V1_3_2025"
),
Routing = list(
Failover = list(
SecondaryRegion = "string",
PrimaryRoute53HealthCheckId = "string"
)
)
)