From d50951d8c2522456a1d74c61708d1414cb71e721 Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Fri, 10 Jan 2025 18:03:52 +1100 Subject: [PATCH] `azurerm_redis_cache` - `minimum_tls_version` no longer accepts `1.0`or `1.1` as a value in 5.0 (#28443) * `azurerm_redis_cache` - `minimum_tls_version` no longer accepts `1.0` or `1.1` as a value in 5.0 * golint --- internal/services/redis/redis_cache_resource.go | 16 ++++++++++++++-- website/docs/5.0-upgrade-guide.html.markdown | 4 ++++ website/docs/r/redis_cache.html.markdown | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/internal/services/redis/redis_cache_resource.go b/internal/services/redis/redis_cache_resource.go index 3de3a2a4c349..97330b5e0ccf 100644 --- a/internal/services/redis/redis_cache_resource.go +++ b/internal/services/redis/redis_cache_resource.go @@ -25,6 +25,7 @@ import ( "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" azValidate "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" + "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/locks" "github.com/hashicorp/terraform-provider-azurerm/internal/services/network" "github.com/hashicorp/terraform-provider-azurerm/internal/services/redis/migration" @@ -104,8 +105,6 @@ func resourceRedisCache() *pluginsdk.Resource { Optional: true, Default: string(redis.TlsVersionOnePointTwo), ValidateFunc: validation.StringInSlice([]string{ - string(redis.TlsVersionOnePointZero), - string(redis.TlsVersionOnePointOne), string(redis.TlsVersionOnePointTwo), }, false), }, @@ -398,6 +397,19 @@ func resourceRedisCache() *pluginsdk.Resource { ), } + if !features.FivePointOhBeta() { + resource.Schema["minimum_tls_version"] = &pluginsdk.Schema{ + Type: pluginsdk.TypeString, + Optional: true, + Default: string(redis.TlsVersionOnePointTwo), + ValidateFunc: validation.StringInSlice([]string{ + string(redis.TlsVersionOnePointZero), + string(redis.TlsVersionOnePointOne), + string(redis.TlsVersionOnePointTwo), + }, false), + } + } + return resource } diff --git a/website/docs/5.0-upgrade-guide.html.markdown b/website/docs/5.0-upgrade-guide.html.markdown index 151258339cd2..fa968275aede 100644 --- a/website/docs/5.0-upgrade-guide.html.markdown +++ b/website/docs/5.0-upgrade-guide.html.markdown @@ -145,6 +145,10 @@ Please follow the format in the example below for listing breaking changes in re * The deprecated `logging_storage_account` block has been removed in favour of the `azurerm_monitor_diagnostic_setting` resource. * The deprecated `managed_resource_group` property has been removed. +### `azurerm_redis_cache` + +* The property `minimum_tls_version` no longer accepts `1.0` or `1.1` as a value. + ### `azurerm_redis_enterprise_cluster` * The property `minimum_tls_version` property no longer accepts `1.0` or `1.1` as a value. diff --git a/website/docs/r/redis_cache.html.markdown b/website/docs/r/redis_cache.html.markdown index a90100d447f0..f61304348668 100644 --- a/website/docs/r/redis_cache.html.markdown +++ b/website/docs/r/redis_cache.html.markdown @@ -67,6 +67,8 @@ The following arguments are supported: * `minimum_tls_version` - (Optional) The minimum TLS version. Possible values are `1.0`, `1.1` and `1.2`. Defaults to `1.0`. +~> **NOTE:** Azure Services will require TLS 1.2+ by August 2025, please see this [announcement](https://azure.microsoft.com/en-us/updates/v2/update-retirement-tls1-0-tls1-1-versions-azure-services/) for more. + * `patch_schedule` - (Optional) A list of `patch_schedule` blocks as defined below. * `private_static_ip_address` - (Optional) The Static IP Address to assign to the Redis Cache when hosted inside the Virtual Network. This argument implies the use of `subnet_id`. Changing this forces a new resource to be created.