AWS Amazon Cognito User Pool Ui Customization

This page shows how to write Terraform and CloudFormation for Amazon Cognito User Pool Ui Customization and write them securely.

aws_cognito_user_pool_ui_customization (Terraform)

The User Pool Ui Customization in Amazon Cognito can be configured in Terraform with the resource name aws_cognito_user_pool_ui_customization. The following sections describe 3 examples of how to use the resource and its parameters.

Example Usage from GitHub

cognito_user_pool_ui_customization.tf#L4
resource "aws_cognito_user_pool_ui_customization" "cognito_user_pool_ui_customization" {
  count = var.enable_cognito_user_pool_ui_customization ? 1 : 0

  user_pool_id = var.cognito_user_pool_ui_customization_user_pool_id != "" ? var.cognito_user_pool_ui_customization_user_pool_id : (var.enable_cognito_user_pool_domain ? aws_cognito_user_pool_domain.cognito_user_pool_domain[count.index].user_pool_id : null)

  client_id  = var.cognito_user_pool_ui_customization_client_id != "" ? var.cognito_user_pool_ui_customization_client_id : (var.enable_cognito_user_pool_client ? aws_cognito_user_pool_client.cognito_user_pool_client[count.index].id : null)
cognito_user_pool_ui_customization.tf#L4
resource "aws_cognito_user_pool_ui_customization" "cognito_user_pool_ui_customization" {
  count = var.enable_cognito_user_pool_ui_customization ? 1 : 0

  user_pool_id = var.cognito_user_pool_ui_customization_user_pool_id != "" ? var.cognito_user_pool_ui_customization_user_pool_id : (var.enable_cognito_user_pool_domain ? aws_cognito_user_pool_domain.cognito_user_pool_domain[count.index].user_pool_id : null)

  client_id  = var.cognito_user_pool_ui_customization_client_id != "" ? var.cognito_user_pool_ui_customization_client_id : (var.enable_cognito_user_pool_client ? aws_cognito_user_pool_client.cognito_user_pool_client[count.index].id : null)
cognito_userpool_base.tf#L40
resource "aws_cognito_user_pool_ui_customization" "user_pool_ui_customization" {
  # Refer to the aws_cognito_user_pool_domain resource's
  # user_pool_id attribute to ensure it is in an 'Active' state
  user_pool_id = aws_cognito_user_pool_domain.main.user_pool_id

  # I know this is ugly, but it works we could find something more sophisticated in the future if needed

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a Cognito User Pool UI Customization resource.

Note: To use this resource, the user pool must have a domain associated with it. For more information, see the Amazon Cognito Developer Guide on Customizing the Built-in Sign-In and Sign-up Webpages.

AWS::Cognito::UserPoolUICustomizationAttachment (CloudFormation)

The UserPoolUICustomizationAttachment in Cognito can be configured in CloudFormation with the resource name AWS::Cognito::UserPoolUICustomizationAttachment. The following sections describe 8 examples of how to use the resource and its parameters.

Example Usage from GitHub

auth-resources.template.yaml#L23
    Type: AWS::Cognito::UserPoolUICustomizationAttachment
    Properties:
      ClientId: !Ref UserPoolClient
      UserPoolId: !Ref UserPool
  CognitoDomain:
    Type: AWS::Cognito::UserPoolDomain
product.template-ap-south-1.yaml#L12
    Type: AWS::Cognito::UserPoolUICustomizationAttachment
    Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpooluicustomizationattachment.html
    Properties:
      UserPoolId: !Ref 'UserPoolId'
      ClientId: !Ref 'ClientId'
product.template-ap-northeast-1.yaml#L12
    Type: AWS::Cognito::UserPoolUICustomizationAttachment
    Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpooluicustomizationattachment.html
    Properties:
      UserPoolId: !Ref 'UserPoolId'
      ClientId: !Ref 'ClientId'
aws-cognito-UserPoolUICustomizationAttachment.yaml#L12
    Type: AWS::Cognito::UserPoolUICustomizationAttachment
    Properties:
      ClientId: !Ref clientid
      UserPoolId: !Ref userpoolid
product.template-us-east-1.yaml#L12
    Type: AWS::Cognito::UserPoolUICustomizationAttachment
    Description: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpooluicustomizationattachment.html
    Properties:
      UserPoolId: !Ref 'UserPoolId'
      ClientId: !Ref 'ClientId'
CognitoUserPoolUICustomizationAttachmentSpecification.json#L3
    "AWS::Cognito::UserPoolUICustomizationAttachment": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpooluicustomizationattachment.html",
      "Properties": {
        "CSS": {
          "Required": false,
          "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpooluicustomizationattachment.html#cfn-cognito-userpooluicustomizationattachment-css",
template.json#L2475
    "AWS::Cognito::UserPoolUICustomizationAttachment": {
      "Type": "AWS::Cognito::UserPoolUICustomizationAttachment",
      "Properties": {}
    },
    "AWS::RDS::DBParameterGroup": {
      "Type": "AWS::RDS::DBParameterGroup",
awsResouceIconMatches.json#L1288
        "resourceType": "AWS::Cognito::UserPoolUICustomizationAttachment",
        "filePath": null
      },
      {
        "resourceType": "AWS::Cognito::UserPoolDomain",
        "filePath": null

Parameters

Explanation in CloudFormation Registry

The AWS::Cognito::UserPoolUICustomizationAttachment resource sets the UI customization information for a user pool's built-in app UI.

You can specify app UI customization settings for a single client (with a specific clientId) or for all clients (by setting the clientId to ALL). If you specify ALL, the default configuration is used for every client that has had no UI customization set previously. If you specify UI customization settings for a particular client, it no longer falls back to the ALL configuration.

Note Before you create this resource, your user pool must have a domain associated with it. You can create an AWS::Cognito::UserPoolDomain resource first in this user pool.

Setting a logo image isn't supported from AWS CloudFormation. Use the Amazon Cognito SetUICustomization API operation to set the image.

Frequently asked questions

What is AWS Amazon Cognito User Pool Ui Customization?

AWS Amazon Cognito User Pool Ui Customization is a resource for Amazon Cognito of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon Cognito User Pool Ui Customization?

For Terraform, the asrkata/SebastianUA-terraform, SebastianUA/terraform and eandresr/aircalltest source code examples are useful. See the Terraform Example section for further details.

For CloudFormation, the desmondappiahkubi/quickstart-onica-cci-postcall-analytics, awslabs/aws-service-catalog-products and awslabs/aws-service-catalog-products source code examples are useful. See the CloudFormation Example section for further details.