FrontdoorCustomDomain

class FrontdoorCustomDomain : KotlinCustomResource

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.dns.Zone;
import com.pulumi.azure.dns.ZoneArgs;
import com.pulumi.azure.cdn.FrontdoorProfile;
import com.pulumi.azure.cdn.FrontdoorProfileArgs;
import com.pulumi.azure.cdn.FrontdoorCustomDomain;
import com.pulumi.azure.cdn.FrontdoorCustomDomainArgs;
import com.pulumi.azure.cdn.inputs.FrontdoorCustomDomainTlsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleZone = new Zone("exampleZone", ZoneArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.build());
var exampleFrontdoorProfile = new FrontdoorProfile("exampleFrontdoorProfile", FrontdoorProfileArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.skuName("Standard_AzureFrontDoor")
.build());
var exampleFrontdoorCustomDomain = new FrontdoorCustomDomain("exampleFrontdoorCustomDomain", FrontdoorCustomDomainArgs.builder()
.cdnFrontdoorProfileId(exampleFrontdoorProfile.id())
.dnsZoneId(exampleZone.id())
.hostName("contoso.fabrikam.com")
.tls(FrontdoorCustomDomainTlsArgs.builder()
.certificateType("ManagedCertificate")
.minimumTlsVersion("TLS12")
.build())
.build());
}
}

Example CNAME Record Usage

!>IMPORTANT: You must include the depends_on meta-argument which references both the azure.cdn.FrontdoorRoute and the azure.cdn.FrontdoorSecurityPolicy that are associated with your Custom Domain. The reason for these depends_on meta-arguments is because all of the resources for the Custom Domain need to be associated within Front Door before the CNAME record can be written to the domains DNS, else the CNAME validation will fail and Front Door will not enable traffic to the Domain.

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.dns.CNameRecord("example", {
zoneName: azurerm_dns_zone.example.name,
resourceGroupName: azurerm_resource_group.example.name,
ttl: 3600,
record: azurerm_cdn_frontdoor_endpoint.example.host_name,
}, {
dependsOn: [
azurerm_cdn_frontdoor_route.example,
azurerm_cdn_frontdoor_security_policy.example,
],
});
import pulumi
import pulumi_azure as azure
example = azure.dns.CNameRecord("example",
zone_name=azurerm_dns_zone["example"]["name"],
resource_group_name=azurerm_resource_group["example"]["name"],
ttl=3600,
record=azurerm_cdn_frontdoor_endpoint["example"]["host_name"],
opts=pulumi.ResourceOptions(depends_on=[
azurerm_cdn_frontdoor_route["example"],
azurerm_cdn_frontdoor_security_policy["example"],
]))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Dns.CNameRecord("example", new()
{
ZoneName = azurerm_dns_zone.Example.Name,
ResourceGroupName = azurerm_resource_group.Example.Name,
Ttl = 3600,
Record = azurerm_cdn_frontdoor_endpoint.Example.Host_name,
}, new CustomResourceOptions
{
DependsOn = new[]
{
azurerm_cdn_frontdoor_route.Example,
azurerm_cdn_frontdoor_security_policy.Example,
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dns"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := dns.NewCNameRecord(ctx, "example", &dns.CNameRecordArgs{
ZoneName: pulumi.Any(azurerm_dns_zone.Example.Name),
ResourceGroupName: pulumi.Any(azurerm_resource_group.Example.Name),
Ttl: pulumi.Int(3600),
Record: pulumi.Any(azurerm_cdn_frontdoor_endpoint.Example.Host_name),
}, pulumi.DependsOn([]pulumi.Resource{
azurerm_cdn_frontdoor_route.Example,
azurerm_cdn_frontdoor_security_policy.Example,
}))
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.dns.CNameRecord;
import com.pulumi.azure.dns.CNameRecordArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new CNameRecord("example", CNameRecordArgs.builder()
.zoneName(azurerm_dns_zone.example().name())
.resourceGroupName(azurerm_resource_group.example().name())
.ttl(3600)
.record(azurerm_cdn_frontdoor_endpoint.example().host_name())
.build(), CustomResourceOptions.builder()
.dependsOn(
azurerm_cdn_frontdoor_route.example(),
azurerm_cdn_frontdoor_security_policy.example())
.build());
}
}
resources:
example:
type: azure:dns:CNameRecord
properties:
zoneName: ${azurerm_dns_zone.example.name}
resourceGroupName: ${azurerm_resource_group.example.name}
ttl: 3600
record: ${azurerm_cdn_frontdoor_endpoint.example.host_name}
options:
dependson:
- ${azurerm_cdn_frontdoor_route.example}
- ${azurerm_cdn_frontdoor_security_policy.example}

Import

Front Door Custom Domains can be imported using the resource id, e.g.

$ pulumi import azure:cdn/frontdoorCustomDomain:FrontdoorCustomDomain example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Cdn/profiles/profile1/customDomains/customDomain1

Properties

Link copied to clipboard

The ID of the Front Door Profile. Changing this forces a new Front Door Profile to be created.

Link copied to clipboard
val dnsZoneId: Output<String>?

The ID of the Azure DNS Zone which should be used for this Front Door Custom Domain. If you are using Azure to host your DNS domains, you must delegate the domain provider's domain name system (DNS) to an Azure DNS Zone. For more information, see Delegate a domain to Azure DNS. Otherwise, if you're using your own domain provider to handle your DNS, you must validate the Front Door Custom Domain by creating the DNS TXT records manually.

Link copied to clipboard
val expirationDate: Output<String>

The date time that the token expires.

Link copied to clipboard
val hostName: Output<String>

The host name of the domain. The host_name field must be the FQDN of your domain(e.g. contoso.fabrikam.com). Changing this forces a new Front Door Custom Domain to be created.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name which should be used for this Front Door Custom Domain. Possible values must be between 2 and 260 characters in length, must begin with a letter or number, end with a letter or number and contain only letters, numbers and hyphens. Changing this forces a new Front Door Custom Domain to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A tls block as defined below.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val validationToken: Output<String>

Challenge used for DNS TXT record or file based validation.