AWS::Cognito::UserPoolUICustomizationAttachment - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


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.


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 Amazon CloudFormation. Use the Amazon Cognito SetUICustomization API operation to set the image.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::Cognito::UserPoolUICustomizationAttachment", "Properties" : { "ClientId" : String, "CSS" : String, "UserPoolId" : String } }


Type: AWS::Cognito::UserPoolUICustomizationAttachment Properties: ClientId: String CSS: String UserPoolId: String



The client ID for the client app. You can specify the UI customization settings for a single client (with a specific clientId) or for all clients (by setting the clientId to ALL).

Required: Yes

Type: String

Pattern: [\w+]+

Minimum: 1

Maximum: 128

Update requires: Replacement


The CSS values in the UI customization.

Required: No

Type: String

Minimum: 0

Maximum: 131072

Update requires: No interruption


The user pool ID for the user pool.

Required: Yes

Type: String

Pattern: [\w-]+_[0-9a-zA-Z]+

Minimum: 1

Maximum: 55

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the physicalResourceId, which is “UserPoolUICustomizationAttachment-UserPoolId-ClientId". For example:

{ "Ref": "UserPoolUICustomizationAttachment-us-east-1_FAKEPOOLID-2asc123fakeclientidajjulj6bh" }

For the Amazon Cognito user pool domain UserPoolUICustomizationAttachment-us-east-1_FAKEPOOLID-2asc123fakeclientidajjulj6bh, Ref returns the name of the UI customization attachment.

For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


The resource ID.


Creating a new UI customization attachment for a user pool

The following example sets UI customization settings in the referenced user pool and client.


{ "UserPoolUICustomization":{ "Type":"AWS::Cognito::UserPoolUICustomizationAttachment", "Properties":{ "UserPoolId":{ "Ref":"UserPool" }, "ClientId":{ "Ref":"Client" }, "CSS":".banner-customizable {\nbackground: linear-gradient(#9940B8, #C27BDB)\n}" } } }


UserPoolUICustomization: Type: AWS::Cognito::UserPoolUICustomizationAttachment Properties: UserPoolId: !Ref UserPool ClientId: !Ref Client CSS: ".banner-customizable { background: linear-gradient(#9940B8, #C27BDB) }"