Azure CDN Endpoint Custom Domain

This page shows how to write Terraform and Azure Resource Manager for CDN Endpoint Custom Domain and write them securely.

azurerm_cdn_endpoint_custom_domain (Terraform)

The Endpoint Custom Domain in CDN can be configured in Terraform with the resource name azurerm_cdn_endpoint_custom_domain. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

custom_domains.tf#L1
resource "azurerm_cdn_endpoint_custom_domain" "this" {
  for_each = { for frontend in var.shutter_apps : frontend.name => frontend
  }

  name            = replace(each.value.custom_domain, ".", "-")
  cdn_endpoint_id = azurerm_cdn_endpoint.shutter_endpoint[each.value.name].id

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • name - (Required) The name which should be used for this CDN Endpoint Custom Domain. Changing this forces a new CDN Endpoint Custom Domain to be created.

  • cdn_endpoint_id - (Required) The ID of the CDN Endpoint. Changing this forces a new CDN Endpoint Custom Domain to be created.

  • host_name - (Required) The host name of the custom domain. Changing this forces a new CDN Endpoint Custom Domain to be created.

Note: At this time only HTTP Custom Domains are supported.

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the CDN Endpoint Custom Domain.

Explanation in Terraform Registry

Manages a Custom Domain for a CDN Endpoint.

Microsoft.Cdn/profiles/endpoints/customDomains (Azure Resource Manager)

The profiles/endpoints/customDomains in Microsoft.Cdn can be configured in Azure Resource Manager with the resource name Microsoft.Cdn/profiles/endpoints/customDomains. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • name required - string

    Name of the custom domain within an endpoint.

  • properties required
      • hostName required - string

        The host name of the custom domain. Must be a domain name.

  • type required - string

Frequently asked questions

What is Azure CDN Endpoint Custom Domain?

Azure CDN Endpoint Custom Domain is a resource for CDN of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure CDN Endpoint Custom Domain?

For Terraform, the hmcts/sharedservices-azure-platform source code example is useful. See the Terraform Example section for further details.