hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.5k stars 4.59k forks source link

Cannnot set min TLS version to 1.3 on mssql_server #26240

Open peer-lhind opened 2 months ago

peer-lhind commented 2 months ago

Is there an existing issue for this?

Community Note

Terraform Version

1.8.5

AzureRM Provider Version

3.106.1

Affected Resource(s)/Data Source(s)

azurerm_mssql_server

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "example-rg"
  location = "West Europe"
}

resource "azurerm_mssql_server" "example" {
  name                         = "example-sqlserver"
  resource_group_name          = azurerm_resource_group.example.name
  location                     = azurerm_resource_group.example.location
  version                      = "12.0"
  administrator_login          = "4dm1n157r470r"
  administrator_login_password = "4-v3ry-53cr37-p455w0rd"
  minimum_tls_version          = "1.3"
}

Debug Output/Panic Output

╷
│ Error: expected minimum_tls_version to be one of ["1.0" "1.1" "1.2" "Disabled"], got 1.3
│
│   with azurerm_mssql_server.example,
│   on db.tf line 13, in resource "azurerm_mssql_server" "example":
│   13:   minimum_tls_version          = "1.3"
│
╵

Expected Behaviour

A database server should be created with a minimum TLS setting of 1.3.

Actual Behaviour

The plan step fails.

Steps to Reproduce

No response

Important Factoids

No response

References

'1.3' is a valid version number according to https://learn.microsoft.com/en-us/rest/api/sql/servers/create-or-update?view=rest-sql-2023-08-01-preview&tabs=HTTP#request-body .

Chambras commented 2 months ago

Hi @peer-lhind I think the reason is because of the API azurerm is using. We might need to upgrade it to 2023-08-01. I will see if it is an easy/fast change. If so, I will submit a PR soon.