azurermStaticSiteCustomDomain
Manages a Static Site Custom Domain.
!> DNS validation polling is only done for CNAME records, terraform will not validate TXT validation records are complete.
Example Usage
CNAME validation
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermStaticSiteExample = new azurerm.staticSite.StaticSite(
this,
"example_1",
{
location: azurermResourceGroupExample.location,
name: "example",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStaticSiteExample.overrideLogicalId("example");
const azurermDnsCnameRecordExample = new azurerm.dnsCnameRecord.DnsCnameRecord(
this,
"example_2",
{
name: "my-domain",
record: azurermStaticSiteExample.defaultHostName,
resource_group_name: azurermResourceGroupExample.name,
ttl: 300,
zone_name: "contoso.com",
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDnsCnameRecordExample.overrideLogicalId("example");
const azurermStaticSiteCustomDomainExample =
new azurerm.staticSiteCustomDomain.StaticSiteCustomDomain(this, "example_3", {
domain_name: `\${${azurermDnsCnameRecordExample.name}}.\${${azurermDnsCnameRecordExample.zoneName}}`,
static_site_id: azurermStaticSiteExample.id,
validation_type: "cname-delegation",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStaticSiteCustomDomainExample.overrideLogicalId("example");
TXT validation
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-resources",
}
);
const azurermStaticSiteExample = new azurerm.staticSite.StaticSite(
this,
"example_1",
{
location: azurermResourceGroupExample.location,
name: "example",
resource_group_name: azurermResourceGroupExample.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermStaticSiteExample.overrideLogicalId("example");
Arguments Reference
The following arguments are supported:
-
domainName
- (Required) The Domain Name which should be associated with this Static Site. Changing this forces a new Static Site Custom Domain to be created. -
staticSiteId
- (Required) The ID of the Static Site. Changing this forces a new Static Site Custom Domain to be created. -
validationType
- (Optional) One ofcnameDelegation
ordnsTxtToken
. Changing this forces a new Static Site Custom Domain to be created.
Attributes Reference
In addition to the Arguments listed above - the following Attributes are exported:
-
id
- The ID of the Static Site Custom Domain. -
validationToken
- Token to be used withdnsTxtToken
validation.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Static Site Custom Domain.read
- (Defaults to 5 minutes) Used when retrieving the Static Site Custom Domain.update
- (Defaults to 30 minutes) Used when updating the Static Site Custom Domain.delete
- (Defaults to 30 minutes) Used when deleting the Static Site Custom Domain.
Import
Static Site Custom Domains can be imported using the resourceId
, e.g.