Resource: auth0_custom_domain_verification

With Auth0, you can use a custom domain to maintain a consistent user experience. This is a three-step process; you must configure the custom domain in Auth0, then create a DNS record for the domain, then verify the DNS record in Auth0. This resource allows for automating the verification part of the process.

Example Usage

# Example of a custom domain managed through DigitalOcean and verified using this resource.

resource "auth0_custom_domain" "my_custom_domain" {
  domain = "login.example.com"
  type   = "auth0_managed_certs"
}

resource "auth0_custom_domain_verification" "my_custom_domain_verification" {
  depends_on = [digitalocean_record.my_domain_name_record]

  custom_domain_id = auth0_custom_domain.my_custom_domain.id

  timeouts { create = "15m" }
}

resource "digitalocean_record" "my_domain_name_record" {
  domain = "example.com"
  type   = upper(auth0_custom_domain.my_custom_domain.verification[0].methods[0].name)
  name   = "${auth0_custom_domain.my_custom_domain.domain}."
  value  = "${auth0_custom_domain.my_custom_domain.verification[0].methods[0].record}."
}

Schema

Required

Optional

Read-Only

Nested Schema for timeouts

Optional:

Meta-Arguments

auth0_custom_domain_verification can be used with the depends_on meta-argument to explicitly wait for the domain name record (DNS) to be created before attempting to verify the custom domain.

Import

Import is supported using the following syntax:

# You can import this resource using the custom domain ID.
#
# Example:
terraform import auth0_custom_domain_verification.my_custom_domain_verification "cd_XXXXXXXXXXXXXXXX"