Skip to content

Commit

Permalink
azurerm_mssql_managed_instance - minimum_tls_version no longer ac…
Browse files Browse the repository at this point in the history
…cepts `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
  • Loading branch information
ziyeqf authored Jan 7, 2025
1 parent 7d93d83 commit 4a33e95
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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),
},
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions website/docs/5.0-upgrade-guide.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/mssql_managed_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down

0 comments on commit 4a33e95

Please sign in to comment.