From 4a33e9577febd3e327ac16ca434edeaa5b10c867 Mon Sep 17 00:00:00 2001 From: ziyeqf <51212351+ziyeqf@users.noreply.github.com> Date: Wed, 8 Jan 2025 01:01:33 +1100 Subject: [PATCH] `azurerm_mssql_managed_instance` - `minimum_tls_version` no longer accepts `1.0` or `1.1` as a value in 5.0 (#28243) * `azurerm_mssql_managed_instance` - `minimum_tls_version` no longer accepts `1.0` or `1.1` as a value in 5.0 * fix acctest * update test case --- .../mssql_managed_instance_resource.go | 19 ++++++++++++++++--- .../mssql_managed_instance_resource_test.go | 4 +--- website/docs/5.0-upgrade-guide.html.markdown | 4 ++++ .../r/mssql_managed_instance.html.markdown | 2 ++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go b/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go index 71a48853a4a4..1093bd2afceb 100644 --- a/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go +++ b/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2023-04-01/publicmaintenanceconfigurations" "github.com/hashicorp/go-azure-sdk/resource-manager/sql/2023-08-01-preview/managedinstances" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-provider-azurerm/internal/features" "github.com/hashicorp/terraform-provider-azurerm/internal/sdk" "github.com/hashicorp/terraform-provider-azurerm/internal/services/mssqlmanagedinstance/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tags" @@ -81,7 +82,7 @@ func (r MsSqlManagedInstanceResource) IDValidationFunc() pluginsdk.SchemaValidat } func (r MsSqlManagedInstanceResource) Arguments() map[string]*pluginsdk.Schema { - return map[string]*pluginsdk.Schema{ + args := map[string]*pluginsdk.Schema{ "name": { Type: schema.TypeString, Required: true, @@ -199,8 +200,6 @@ func (r MsSqlManagedInstanceResource) Arguments() map[string]*pluginsdk.Schema { Optional: true, Default: "1.2", ValidateFunc: validation.StringInSlice([]string{ - "1.0", - "1.1", "1.2", }, false), }, @@ -258,6 +257,20 @@ func (r MsSqlManagedInstanceResource) Arguments() map[string]*pluginsdk.Schema { "tags": tags.Schema(), } + + if !features.FivePointOhBeta() { + args["minimum_tls_version"] = &pluginsdk.Schema{ + Type: schema.TypeString, + Optional: true, + Default: "1.2", + ValidateFunc: validation.StringInSlice([]string{ + "1.0", + "1.1", + "1.2", + }, false), + } + } + return args } func (r MsSqlManagedInstanceResource) Attributes() map[string]*pluginsdk.Schema { diff --git a/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource_test.go b/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource_test.go index 275f9f9af4e5..d583f2d466ad 100644 --- a/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource_test.go +++ b/internal/services/mssqlmanagedinstance/mssql_managed_instance_resource_test.go @@ -420,7 +420,6 @@ resource "azurerm_mssql_managed_instance" "test" { storage_size_in_gb = 32 subnet_id = azurerm_subnet.test.id vcores = 4 - timezone_id = "Pacific Standard Time" administrator_login = "missadministrator" administrator_login_password = "NCC-1701-D" @@ -650,14 +649,13 @@ resource "azurerm_mssql_managed_instance" "test" { location = azurerm_resource_group.test.location license_type = "BasePrice" - minimum_tls_version = "1.0" + minimum_tls_version = "1.2" proxy_override = "Proxy" public_data_endpoint_enabled = true sku_name = "GP_Gen5" storage_account_type = "ZRS" storage_size_in_gb = 64 subnet_id = azurerm_subnet.test.id - timezone_id = "Pacific Standard Time" vcores = 8 zone_redundant_enabled = true diff --git a/website/docs/5.0-upgrade-guide.html.markdown b/website/docs/5.0-upgrade-guide.html.markdown index d97db8f6f291..d8fcd635f41f 100644 --- a/website/docs/5.0-upgrade-guide.html.markdown +++ b/website/docs/5.0-upgrade-guide.html.markdown @@ -124,6 +124,10 @@ Please follow the format in the example below for listing breaking changes in re * The properties `weekly_retention`, `monthly_retention` and `yearly_retention` now default to `PT0S`. +### `azurerm_mssql_managed_instance` + +* The property `minimum_tls_version` no longer accepts `1.0` or `1.1` as a value. + ### `azurerm_mssql_server` * The property `minimum_tls_version` no longer accepts `Disabled`, `1.0` or `1.1` as a value. diff --git a/website/docs/r/mssql_managed_instance.html.markdown b/website/docs/r/mssql_managed_instance.html.markdown index e85b59c84d6b..8ee86aff66a2 100644 --- a/website/docs/r/mssql_managed_instance.html.markdown +++ b/website/docs/r/mssql_managed_instance.html.markdown @@ -237,6 +237,8 @@ The following arguments are supported: * `minimum_tls_version` - (Optional) The Minimum TLS Version. Default value is `1.2` Valid values include `1.0`, `1.1`, `1.2`. +~> **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. + * `proxy_override` - (Optional) Specifies how the SQL Managed Instance will be accessed. Default value is `Default`. Valid values include `Default`, `Proxy`, and `Redirect`. * `public_data_endpoint_enabled` - (Optional) Is the public data endpoint enabled? Default value is `false`.