AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

UserPoolUICustomization

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.

Example Usage

UI customization settings for a single client

using System;
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
	private static string ReadFileBase64(string path) {
		return Convert.ToBase64String(Encoding.UTF8.GetBytes(File.ReadAllText(path)))
	}

    public MyStack()
    {
        var exampleUserPool = new Aws.Cognito.UserPool("exampleUserPool", new Aws.Cognito.UserPoolArgs
        {
        });
        var exampleUserPoolDomain = new Aws.Cognito.UserPoolDomain("exampleUserPoolDomain", new Aws.Cognito.UserPoolDomainArgs
        {
            Domain = "example",
            UserPoolId = exampleUserPool.Id,
        });
        var exampleUserPoolClient = new Aws.Cognito.UserPoolClient("exampleUserPoolClient", new Aws.Cognito.UserPoolClientArgs
        {
            UserPoolId = exampleUserPool.Id,
        });
        var exampleUserPoolUICustomization = new Aws.Cognito.UserPoolUICustomization("exampleUserPoolUICustomization", new Aws.Cognito.UserPoolUICustomizationArgs
        {
            ClientId = exampleUserPoolClient.Id,
            Css = ".label-customizable {font-weight: 400;}",
            ImageFile = ReadFileBase64("logo.png"),
            UserPoolId = exampleUserPoolDomain.UserPoolId,
        });
    }

}
package main

import (
	"encoding/base64"
	"io/ioutil"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cognito"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func filebase64OrPanic(path string) pulumi.StringPtrInput {
	if fileData, err := ioutil.ReadFile(path); err == nil {
		return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
	} else {
		panic(err.Error())
	}
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleUserPool, err := cognito.NewUserPool(ctx, "exampleUserPool", nil)
		if err != nil {
			return err
		}
		exampleUserPoolDomain, err := cognito.NewUserPoolDomain(ctx, "exampleUserPoolDomain", &cognito.UserPoolDomainArgs{
			Domain:     pulumi.String("example"),
			UserPoolId: exampleUserPool.ID(),
		})
		if err != nil {
			return err
		}
		exampleUserPoolClient, err := cognito.NewUserPoolClient(ctx, "exampleUserPoolClient", &cognito.UserPoolClientArgs{
			UserPoolId: exampleUserPool.ID(),
		})
		if err != nil {
			return err
		}
		_, err = cognito.NewUserPoolUICustomization(ctx, "exampleUserPoolUICustomization", &cognito.UserPoolUICustomizationArgs{
			ClientId:   exampleUserPoolClient.ID(),
			Css:        pulumi.String(".label-customizable {font-weight: 400;}"),
			ImageFile:  filebase64OrPanic("logo.png"),
			UserPoolId: exampleUserPoolDomain.UserPoolId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleUserPool = new UserPool("exampleUserPool");

        var exampleUserPoolDomain = new UserPoolDomain("exampleUserPoolDomain", UserPoolDomainArgs.builder()        
            .domain("example")
            .userPoolId(exampleUserPool.getId())
            .build());

        var exampleUserPoolClient = new UserPoolClient("exampleUserPoolClient", UserPoolClientArgs.builder()        
            .userPoolId(exampleUserPool.getId())
            .build());

        var exampleUserPoolUICustomization = new UserPoolUICustomization("exampleUserPoolUICustomization", UserPoolUICustomizationArgs.builder()        
            .clientId(exampleUserPoolClient.getId())
            .css(".label-customizable {font-weight: 400;}")
            .imageFile(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("logo.png"))))
            .userPoolId(exampleUserPoolDomain.getUserPoolId())
            .build());

        }
}
import pulumi
import base64
import pulumi_aws as aws

example_user_pool = aws.cognito.UserPool("exampleUserPool")
example_user_pool_domain = aws.cognito.UserPoolDomain("exampleUserPoolDomain",
    domain="example",
    user_pool_id=example_user_pool.id)
example_user_pool_client = aws.cognito.UserPoolClient("exampleUserPoolClient", user_pool_id=example_user_pool.id)
example_user_pool_ui_customization = aws.cognito.UserPoolUICustomization("exampleUserPoolUICustomization",
    client_id=example_user_pool_client.id,
    css=".label-customizable {font-weight: 400;}",
    image_file=(lambda path: base64.b64encode(open(path).read().encode()).decode())("logo.png"),
    user_pool_id=example_user_pool_domain.user_pool_id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * from "fs";

const exampleUserPool = new aws.cognito.UserPool("exampleUserPool", {});
const exampleUserPoolDomain = new aws.cognito.UserPoolDomain("exampleUserPoolDomain", {
    domain: "example",
    userPoolId: exampleUserPool.id,
});
const exampleUserPoolClient = new aws.cognito.UserPoolClient("exampleUserPoolClient", {userPoolId: exampleUserPool.id});
const exampleUserPoolUICustomization = new aws.cognito.UserPoolUICustomization("exampleUserPoolUICustomization", {
    clientId: exampleUserPoolClient.id,
    css: ".label-customizable {font-weight: 400;}",
    imageFile: Buffer.from(fs.readFileSync("logo.png"), 'binary').toString('base64'),
    userPoolId: exampleUserPoolDomain.userPoolId,
});

Coming soon!

UI customization settings for all clients

using System;
using System.IO;
using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
	private static string ReadFileBase64(string path) {
		return Convert.ToBase64String(Encoding.UTF8.GetBytes(File.ReadAllText(path)))
	}

    public MyStack()
    {
        var exampleUserPool = new Aws.Cognito.UserPool("exampleUserPool", new Aws.Cognito.UserPoolArgs
        {
        });
        var exampleUserPoolDomain = new Aws.Cognito.UserPoolDomain("exampleUserPoolDomain", new Aws.Cognito.UserPoolDomainArgs
        {
            Domain = "example",
            UserPoolId = exampleUserPool.Id,
        });
        var exampleUserPoolUICustomization = new Aws.Cognito.UserPoolUICustomization("exampleUserPoolUICustomization", new Aws.Cognito.UserPoolUICustomizationArgs
        {
            Css = ".label-customizable {font-weight: 400;}",
            ImageFile = ReadFileBase64("logo.png"),
            UserPoolId = exampleUserPoolDomain.UserPoolId,
        });
    }

}
package main

import (
	"encoding/base64"
	"io/ioutil"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/cognito"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func filebase64OrPanic(path string) pulumi.StringPtrInput {
	if fileData, err := ioutil.ReadFile(path); err == nil {
		return pulumi.String(base64.StdEncoding.EncodeToString(fileData[:]))
	} else {
		panic(err.Error())
	}
}

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleUserPool, err := cognito.NewUserPool(ctx, "exampleUserPool", nil)
		if err != nil {
			return err
		}
		exampleUserPoolDomain, err := cognito.NewUserPoolDomain(ctx, "exampleUserPoolDomain", &cognito.UserPoolDomainArgs{
			Domain:     pulumi.String("example"),
			UserPoolId: exampleUserPool.ID(),
		})
		if err != nil {
			return err
		}
		_, err = cognito.NewUserPoolUICustomization(ctx, "exampleUserPoolUICustomization", &cognito.UserPoolUICustomizationArgs{
			Css:        pulumi.String(".label-customizable {font-weight: 400;}"),
			ImageFile:  filebase64OrPanic("logo.png"),
			UserPoolId: exampleUserPoolDomain.UserPoolId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleUserPool = new UserPool("exampleUserPool");

        var exampleUserPoolDomain = new UserPoolDomain("exampleUserPoolDomain", UserPoolDomainArgs.builder()        
            .domain("example")
            .userPoolId(exampleUserPool.getId())
            .build());

        var exampleUserPoolUICustomization = new UserPoolUICustomization("exampleUserPoolUICustomization", UserPoolUICustomizationArgs.builder()        
            .css(".label-customizable {font-weight: 400;}")
            .imageFile(Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get("logo.png"))))
            .userPoolId(exampleUserPoolDomain.getUserPoolId())
            .build());

        }
}
import pulumi
import base64
import pulumi_aws as aws

example_user_pool = aws.cognito.UserPool("exampleUserPool")
example_user_pool_domain = aws.cognito.UserPoolDomain("exampleUserPoolDomain",
    domain="example",
    user_pool_id=example_user_pool.id)
example_user_pool_ui_customization = aws.cognito.UserPoolUICustomization("exampleUserPoolUICustomization",
    css=".label-customizable {font-weight: 400;}",
    image_file=(lambda path: base64.b64encode(open(path).read().encode()).decode())("logo.png"),
    user_pool_id=example_user_pool_domain.user_pool_id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * from "fs";

const exampleUserPool = new aws.cognito.UserPool("exampleUserPool", {});
const exampleUserPoolDomain = new aws.cognito.UserPoolDomain("exampleUserPoolDomain", {
    domain: "example",
    userPoolId: exampleUserPool.id,
});
const exampleUserPoolUICustomization = new aws.cognito.UserPoolUICustomization("exampleUserPoolUICustomization", {
    css: ".label-customizable {font-weight: 400;}",
    imageFile: Buffer.from(fs.readFileSync("logo.png"), 'binary').toString('base64'),
    userPoolId: exampleUserPoolDomain.userPoolId,
});

Coming soon!

Create a UserPoolUICustomization Resource

new UserPoolUICustomization(name: string, args: UserPoolUICustomizationArgs, opts?: CustomResourceOptions);
@overload
def UserPoolUICustomization(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            client_id: Optional[str] = None,
                            css: Optional[str] = None,
                            image_file: Optional[str] = None,
                            user_pool_id: Optional[str] = None)
@overload
def UserPoolUICustomization(resource_name: str,
                            args: UserPoolUICustomizationArgs,
                            opts: Optional[ResourceOptions] = None)
func NewUserPoolUICustomization(ctx *Context, name string, args UserPoolUICustomizationArgs, opts ...ResourceOption) (*UserPoolUICustomization, error)
public UserPoolUICustomization(string name, UserPoolUICustomizationArgs args, CustomResourceOptions? opts = null)
public UserPoolUICustomization(String name, UserPoolUICustomizationArgs args)
public UserPoolUICustomization(String name, UserPoolUICustomizationArgs args, CustomResourceOptions options)
type: aws:cognito:UserPoolUICustomization
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args UserPoolUICustomizationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args UserPoolUICustomizationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args UserPoolUICustomizationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args UserPoolUICustomizationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args UserPoolUICustomizationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

UserPoolUICustomization Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The UserPoolUICustomization resource accepts the following input properties:

UserPoolId string

The user pool ID for the user pool.

ClientId string

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

Css string

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

ImageFile string

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

UserPoolId string

The user pool ID for the user pool.

ClientId string

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

Css string

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

ImageFile string

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

userPoolId String

The user pool ID for the user pool.

clientId String

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

css String

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

imageFile String

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

userPoolId string

The user pool ID for the user pool.

clientId string

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

css string

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

imageFile string

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

user_pool_id str

The user pool ID for the user pool.

client_id str

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

css str

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

image_file str

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

userPoolId String

The user pool ID for the user pool.

clientId String

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

css String

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

imageFile String

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

Outputs

All input properties are implicitly available as output properties. Additionally, the UserPoolUICustomization resource produces the following output properties:

CreationDate string

The creation date in RFC3339 format for the UI customization.

CssVersion string

The CSS version number.

Id string

The provider-assigned unique ID for this managed resource.

ImageUrl string

The logo image URL for the UI customization.

LastModifiedDate string

The last-modified date in RFC3339 format for the UI customization.

CreationDate string

The creation date in RFC3339 format for the UI customization.

CssVersion string

The CSS version number.

Id string

The provider-assigned unique ID for this managed resource.

ImageUrl string

The logo image URL for the UI customization.

LastModifiedDate string

The last-modified date in RFC3339 format for the UI customization.

creationDate String

The creation date in RFC3339 format for the UI customization.

cssVersion String

The CSS version number.

id String

The provider-assigned unique ID for this managed resource.

imageUrl String

The logo image URL for the UI customization.

lastModifiedDate String

The last-modified date in RFC3339 format for the UI customization.

creationDate string

The creation date in RFC3339 format for the UI customization.

cssVersion string

The CSS version number.

id string

The provider-assigned unique ID for this managed resource.

imageUrl string

The logo image URL for the UI customization.

lastModifiedDate string

The last-modified date in RFC3339 format for the UI customization.

creation_date str

The creation date in RFC3339 format for the UI customization.

css_version str

The CSS version number.

id str

The provider-assigned unique ID for this managed resource.

image_url str

The logo image URL for the UI customization.

last_modified_date str

The last-modified date in RFC3339 format for the UI customization.

creationDate String

The creation date in RFC3339 format for the UI customization.

cssVersion String

The CSS version number.

id String

The provider-assigned unique ID for this managed resource.

imageUrl String

The logo image URL for the UI customization.

lastModifiedDate String

The last-modified date in RFC3339 format for the UI customization.

Look up an Existing UserPoolUICustomization Resource

Get an existing UserPoolUICustomization resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: UserPoolUICustomizationState, opts?: CustomResourceOptions): UserPoolUICustomization
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        client_id: Optional[str] = None,
        creation_date: Optional[str] = None,
        css: Optional[str] = None,
        css_version: Optional[str] = None,
        image_file: Optional[str] = None,
        image_url: Optional[str] = None,
        last_modified_date: Optional[str] = None,
        user_pool_id: Optional[str] = None) -> UserPoolUICustomization
func GetUserPoolUICustomization(ctx *Context, name string, id IDInput, state *UserPoolUICustomizationState, opts ...ResourceOption) (*UserPoolUICustomization, error)
public static UserPoolUICustomization Get(string name, Input<string> id, UserPoolUICustomizationState? state, CustomResourceOptions? opts = null)
public static UserPoolUICustomization get(String name, Output<String> id, UserPoolUICustomizationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ClientId string

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

CreationDate string

The creation date in RFC3339 format for the UI customization.

Css string

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

CssVersion string

The CSS version number.

ImageFile string

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

ImageUrl string

The logo image URL for the UI customization.

LastModifiedDate string

The last-modified date in RFC3339 format for the UI customization.

UserPoolId string

The user pool ID for the user pool.

ClientId string

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

CreationDate string

The creation date in RFC3339 format for the UI customization.

Css string

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

CssVersion string

The CSS version number.

ImageFile string

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

ImageUrl string

The logo image URL for the UI customization.

LastModifiedDate string

The last-modified date in RFC3339 format for the UI customization.

UserPoolId string

The user pool ID for the user pool.

clientId String

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

creationDate String

The creation date in RFC3339 format for the UI customization.

css String

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

cssVersion String

The CSS version number.

imageFile String

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

imageUrl String

The logo image URL for the UI customization.

lastModifiedDate String

The last-modified date in RFC3339 format for the UI customization.

userPoolId String

The user pool ID for the user pool.

clientId string

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

creationDate string

The creation date in RFC3339 format for the UI customization.

css string

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

cssVersion string

The CSS version number.

imageFile string

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

imageUrl string

The logo image URL for the UI customization.

lastModifiedDate string

The last-modified date in RFC3339 format for the UI customization.

userPoolId string

The user pool ID for the user pool.

client_id str

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

creation_date str

The creation date in RFC3339 format for the UI customization.

css str

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

css_version str

The CSS version number.

image_file str

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

image_url str

The logo image URL for the UI customization.

last_modified_date str

The last-modified date in RFC3339 format for the UI customization.

user_pool_id str

The user pool ID for the user pool.

clientId String

The client ID for the client app. Defaults to ALL. If ALL is specified, the css and/or image_file settings will be used for every client that has no UI customization set previously.

creationDate String

The creation date in RFC3339 format for the UI customization.

css String

The CSS values in the UI customization, provided as a String. At least one of css or image_file is required.

cssVersion String

The CSS version number.

imageFile String

The uploaded logo image for the UI customization, provided as a base64-encoded String. Drift detection is not possible for this argument. At least one of css or image_file is required.

imageUrl String

The logo image URL for the UI customization.

lastModifiedDate String

The last-modified date in RFC3339 format for the UI customization.

userPoolId String

The user pool ID for the user pool.

Import

Cognito User Pool UI Customizations can be imported using the user_pool_id and client_id separated by ,, e.g.,

 $ pulumi import aws:cognito/userPoolUICustomization:UserPoolUICustomization example us-west-2_ZCTarbt5C,12bu4fuk3mlgqa2rtrujgp6egq

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.