== How to fix it in Azure Databases

=== Code examples

==== Noncompliant code example

For https://azure.microsoft.com/en-gb/products/azure-sql/database[Azure SQL Database]:

[source,terraform,diff-id=31,diff-type=noncompliant]
----
resource "azurerm_mssql_server" "example" {
  name = "example"
  version = "12.0"

  minimum_tls_version = "1.0" # Noncompliant
}
----

For https://azure.microsoft.com/en-gb/products/mysql[Azure Database for MySQL]:

[source,terraform,diff-id=32,diff-type=noncompliant]
----
resource "azurerm_mysql_server" "example" {
  ssl_minimal_tls_version_enforced = "TLS1_0" # Noncompliant
}
----

For https://azure.microsoft.com/en-gb/products/postgresql[Azure Database for PostgreSQL]:

[source,terraform,diff-id=33,diff-type=noncompliant]
----
resource "azurerm_postgresql_server" "example" {
  ssl_minimal_tls_version_enforced = "TLS1_0" # Noncompliant
}
----

==== Compliant solution

For https://azure.microsoft.com/en-gb/products/azure-sql/database[Azure SQL Database]:

[source,terraform,diff-id=31,diff-type=compliant]
----
resource "azurerm_mssql_server" "example" {
  name = "example"
  version = "12.0"

  minimum_tls_version = "1.2"
}
----

For https://azure.microsoft.com/en-gb/products/mysql[Azure Database for MySQL]:

[source,terraform,diff-id=32,diff-type=compliant]
----
resource "azurerm_mysql_server" "example" {
  ssl_minimal_tls_version_enforced = "TLS1_2"
}
----

For https://azure.microsoft.com/en-gb/products/postgresql[Azure Database for PostgreSQL]:

[source,terraform,diff-id=33,diff-type=compliant]
----
resource "azurerm_postgresql_server" "example" {
  ssl_minimal_tls_version_enforced = "TLS1_2"
}
----

Starting from AzureRM Provider 3.0, `ssl_minimal_tls_version_enforced` is also equal to `TLS1_2` by default for `azurerm_mysql_server` and `azurerm_postgresql_server`.

=== How does this work?

include::../../common/fix/fix.adoc[]
