CognitoIdentityProvider / Client / create_user_pool_domain

create_user_pool_domain#

CognitoIdentityProvider.Client.create_user_pool_domain(**kwargs)#

Creates a new domain for a user pool. The domain hosts user pool domain services like managed login, the hosted UI (classic), and the user pool authorization server.

Note

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

See also: AWS API Documentation

Request Syntax

response = client.create_user_pool_domain(
    Domain='string',
    UserPoolId='string',
    ManagedLoginVersion=123,
    CustomDomainConfig={
        'CertificateArn': 'string'
    }
)
Parameters:
  • Domain (string) –

    [REQUIRED]

    The 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.

  • UserPoolId (string) –

    [REQUIRED]

    The ID of the user pool where you want to add a domain.

  • ManagedLoginVersion (integer) –

    The 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.

  • CustomDomainConfig (dict) –

    The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.

    Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can exclude this parameter and use the Amazon Cognito hosted domain instead.

    For more information about the hosted domain and custom domains, see Configuring a User Pool Domain.

    • CertificateArn (string) – [REQUIRED]

      The Amazon Resource Name (ARN) of an Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.

Return type:

dict

Returns:

Response Syntax

{
    'ManagedLoginVersion': 123,
    'CloudFrontDomain': 'string'
}

Response Structure

  • (dict) –

    • ManagedLoginVersion (integer) –

      The version of managed login branding applied your domain. A value of 1 indicates hosted UI (classic) branding and a version of 2 indicates managed login branding.

    • CloudFrontDomain (string) –

      The Amazon CloudFront endpoint that you use as the target of the alias that you set up with your Domain Name Service (DNS) provider. Amazon Cognito returns this value if you set a custom domain with CustomDomainConfig. If you set an Amazon Cognito prefix domain, this operation returns a blank response.

Exceptions

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.NotAuthorizedException

  • CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException

  • CognitoIdentityProvider.Client.exceptions.LimitExceededException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException

  • CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInTierException