» aws_cognito_user_pool_domain

Provides a Cognito User Pool Domain resource.

» Example Usage

» Amazon Cognito domain

resource "aws_cognito_user_pool_domain" "main" {
  domain       = "example-domain"
  user_pool_id = "${aws_cognito_user_pool.example.id}"
}

resource "aws_cognito_user_pool" "example" {
  name = "example-pool"
}

» Custom Cognito domain

resource "aws_cognito_user_pool_domain" "main" {
  domain          = "example-domain.exemple.com"
  certificate_arn = "${aws_acm_certificate.cert.arn}"
  user_pool_id    = "${aws_cognito_user_pool.example.id}"
}

resource "aws_cognito_user_pool" "example" {
  name = "example-pool"
}

» Argument Reference

The following arguments are supported:

  • domain - (Required) The domain string.
  • user_pool_id - (Required) The user pool ID.
  • certificate_arn - (Optional) The ARN of an ISSUED ACM certificate in us-east-1 for a custom domain.

» Attribute Reference

In addition to all arguments above, the following attributes are exported:

» Import

Cognito User Pool Domains can be imported using the domain, e.g.

$ terraform import aws_cognito_user_pool_domain.main <domain>