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
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)
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)
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
Parameters
-
client_id
optional - string -
creation_date
optional computed - string -
css
optional - string -
css_version
optional computed - string -
id
optional computed - string -
image_file
optional - string -
image_url
optional computed - string -
last_modified_date
optional computed - string -
user_pool_id
required - string
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
Type: AWS::Cognito::UserPoolUICustomizationAttachment
Properties:
ClientId: !Ref UserPoolClient
UserPoolId: !Ref UserPool
CognitoDomain:
Type: AWS::Cognito::UserPoolDomain
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'
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'
Type: AWS::Cognito::UserPoolUICustomizationAttachment
Properties:
ClientId: !Ref clientid
UserPoolId: !Ref userpoolid
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": {
"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",
"AWS::Cognito::UserPoolUICustomizationAttachment": {
"Type": "AWS::Cognito::UserPoolUICustomizationAttachment",
"Properties": {}
},
"AWS::RDS::DBParameterGroup": {
"Type": "AWS::RDS::DBParameterGroup",
"resourceType": "AWS::Cognito::UserPoolUICustomizationAttachment",
"filePath": null
},
{
"resourceType": "AWS::Cognito::UserPoolDomain",
"filePath": null
Parameters
-
CSS
optional - String -
UserPoolId
required - String -
ClientId
required - String
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 theclientId
toALL
). If you specifyALL
, 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 theALL
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.