Skip to content

Commit 3eb20af

Browse files
committed
Initial check-in...
1 parent 933ed9d commit 3eb20af

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

internal/services/cdn/cdn_frontdoor_custom_domain_resource.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,6 @@ func frontDoorCustomDomainHostNameCustomizeDiff(_ context.Context, diff *plugins
720720
return errors.New("`host_name` cannot be longer than 64 characters when `tls.certificate_type` is `ManagedCertificate`")
721721
}
722722

723-
if strings.HasPrefix(hostName, "*.") {
724-
return errors.New("`host_name` cannot be a wildcard domain when `tls.certificate_type` is `ManagedCertificate`")
725-
}
726-
727723
return nil
728724
}
729725

internal/services/cdn/cdn_frontdoor_custom_domain_resource_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func TestAccCdnFrontDoorCustomDomain_cipherSuites_validation(t *testing.T) {
157157
data.ResourceTest(t, r, testSteps)
158158
}
159159

160-
func TestAccCdnFrontDoorCustomDomain_managedCertificate_validation(t *testing.T) {
160+
func TestAccCdnFrontDoorCustomDomain_managedCertificate_hostNameConstraints(t *testing.T) {
161161
data := acceptance.BuildTestData(t, "azurerm_cdn_frontdoor_custom_domain", "test")
162162
r := CdnFrontDoorCustomDomainResource{}
163163
r.preCheck(t)
@@ -168,9 +168,12 @@ func TestAccCdnFrontDoorCustomDomain_managedCertificate_validation(t *testing.T)
168168
ExpectError: regexp.MustCompile("`host_name` cannot be longer than 64 characters when `tls\\.certificate_type` is `ManagedCertificate`"),
169169
},
170170
{
171-
Config: r.managedCertificateWildcardDomain(data),
172-
ExpectError: regexp.MustCompile("`host_name` cannot be a wildcard domain when `tls\\.certificate_type` is `ManagedCertificate`"),
171+
Config: r.managedCertificateWildcardDomain(data),
172+
Check: acceptance.ComposeTestCheckFunc(
173+
check.That(data.ResourceName).ExistsInAzure(r),
174+
),
173175
},
176+
data.ImportStep(),
174177
})
175178
}
176179

@@ -880,5 +883,5 @@ resource "azurerm_cdn_frontdoor_custom_domain" "test" {
880883
minimum_version = "TLS12"
881884
}
882885
}
883-
`, r.validationTemplate(data), data.RandomInteger)
886+
`, r.template(data), data.RandomInteger)
884887
}

website/docs/r/cdn_frontdoor_custom_domain.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ A `tls` block supports the following:
176176

177177
-> **Note:** It may take up to 15 minutes for the Front Door Service to validate the state and domain ownership of the Custom Domain.
178178

179-
~> **Note:** When `certificate_type` is `ManagedCertificate`, `host_name` must not exceed 64 characters. Azure Front Door supports managed certificates for apex domains, but apex-domain certificate rotation can require revalidation of domain ownership. Wildcard domains require `CustomerCertificate`. Use `CustomerCertificate` for wildcard domains or host names longer than 64 characters.
179+
~> **Note:** When `certificate_type` is `ManagedCertificate`, `host_name` must not exceed 64 characters. Azure Front Door supports managed certificates for apex and wildcard domains, but apex-domain certificate rotation can require revalidation of domain ownership and wildcard-domain managed certificates are not rotated automatically.
180180

181181
* `cipher_suite` - (Optional) A `cipher_suite` block as defined below.
182182

0 commit comments

Comments
 (0)