Skip to content

Commit

Permalink
azurerm_cdn_endpoint_custom_domain - cdn_managed_https.tls_version
Browse files Browse the repository at this point in the history
and `user_managed_https.tls_version` no longer accept `None` or `TLS10`
as a value in 5.0
  • Loading branch information
ziyeqf committed Dec 3, 2024
1 parent 9287fe7 commit 34204b5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
27 changes: 23 additions & 4 deletions internal/services/cdn/cdn_endpoint_custom_domain_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
"github.com/hashicorp/terraform-provider-azurerm/helpers/tf"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/features"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/parse"
"github.com/hashicorp/terraform-provider-azurerm/internal/services/cdn/validate"
keyvaultClient "github.com/hashicorp/terraform-provider-azurerm/internal/services/keyvault/client"
Expand Down Expand Up @@ -74,9 +75,7 @@ func resourceArmCdnEndpointCustomDomain() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
string(cdn.MinimumTLSVersionTLS10),
string(cdn.MinimumTLSVersionTLS12),
string(cdn.MinimumTLSVersionNone),
}, false),
Default: string(cdn.MinimumTLSVersionTLS12),
},
Expand All @@ -96,9 +95,7 @@ func resourceArmCdnEndpointCustomDomain() *pluginsdk.Resource {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
string(cdn.MinimumTLSVersionTLS10),
string(cdn.MinimumTLSVersionTLS12),
string(cdn.MinimumTLSVersionNone),
}, false),
Default: string(cdn.MinimumTLSVersionTLS12),
},
Expand All @@ -114,6 +111,28 @@ func resourceArmCdnEndpointCustomDomain() *pluginsdk.Resource {
ValidateFunc: keyvaultValidate.NestedItemIdWithOptionalVersion,
}

if !features.FivePointOhBeta() {
schema["cdn_managed_https"].Elem.(*pluginsdk.Resource).Schema["tls_version"] = &pluginsdk.Schema{
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
string(cdn.MinimumTLSVersionNone),
string(cdn.MinimumTLSVersionTLS10),
string(cdn.MinimumTLSVersionTLS12),
}, false),
Default: string(cdn.MinimumTLSVersionTLS12),
}
schema["user_managed_https"].Elem.(*pluginsdk.Resource).Schema["tls_version"] = &pluginsdk.Schema{
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
string(cdn.MinimumTLSVersionNone),
string(cdn.MinimumTLSVersionTLS10),
string(cdn.MinimumTLSVersionTLS12),
}, false),
Default: string(cdn.MinimumTLSVersionTLS12),
}
}
return &pluginsdk.Resource{
Create: resourceArmCdnEndpointCustomDomainCreate,
Read: resourceArmCdnEndpointCustomDomainRead,
Expand Down
5 changes: 5 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ Please follow the format in the example below for listing breaking changes in re
* The `example_property_with_changed_default` property now defaults to `NewDefault`.
```

### `azurerm_cdn_endpoint_custom_domain`

* The `cdn_managed_https.tls_version` property no langer accepts `None` or `TLS10` as a value.
* The `user_managed_https.tls_version` property no langer accepts `None` or `TLS10` as a value.

### `azurerm_cdn_frontdoor_custom_domain`

* The `tls.minimum_tls_version` property no longer accepts `TLS10` as a value.
Expand Down

0 comments on commit 34204b5

Please sign in to comment.