diff --git a/rest-server/src/main/resources/nubesgen/terraform/modules/sql-server/main.tf.mustache b/rest-server/src/main/resources/nubesgen/terraform/modules/sql-server/main.tf.mustache index 82d7de98f..820194bc9 100644 --- a/rest-server/src/main/resources/nubesgen/terraform/modules/sql-server/main.tf.mustache +++ b/rest-server/src/main/resources/nubesgen/terraform/modules/sql-server/main.tf.mustache @@ -56,19 +56,18 @@ resource "azurerm_mssql_database" "database" { } {{^NetworkVNet}} -resource "azurecaf_name" "sql_firewall_rule" { +resource "azurecaf_name" "mssql_firewall_rule" { name = var.application_name - resource_type = "azurerm_sql_firewall_rule" + resource_type = "mssql_firewall_rule" suffixes = [var.environment] } # This rule is to enable the 'Allow access to Azure services' checkbox -resource "azurerm_sql_firewall_rule" "database" { - name = azurecaf_name.sql_firewall_rule.result - resource_group_name = var.resource_group - server_name = azurerm_mssql_server.database.name - start_ip_address = "0.0.0.0" - end_ip_address = "0.0.0.0" +resource "azurerm_mssql_firewall_rule" "database" { + name = azurecaf_name.mssql_firewall_rule.result + server_id = azurerm_mssql_server.database.id + start_ip_address = "0.0.0.0" + end_ip_address = "0.0.0.0" } {{/NetworkVNet}} {{#NetworkVNet}} diff --git a/rest-server/src/test/resources/nubesgen/terraform/app-service-dotnet/terraform/modules/sql-server/main.tf b/rest-server/src/test/resources/nubesgen/terraform/app-service-dotnet/terraform/modules/sql-server/main.tf index 5dd5b5add..19f97e89b 100644 --- a/rest-server/src/test/resources/nubesgen/terraform/app-service-dotnet/terraform/modules/sql-server/main.tf +++ b/rest-server/src/test/resources/nubesgen/terraform/app-service-dotnet/terraform/modules/sql-server/main.tf @@ -50,17 +50,16 @@ resource "azurerm_mssql_database" "database" { auto_pause_delay_in_minutes = 60 } -resource "azurecaf_name" "sql_firewall_rule" { +resource "azurecaf_name" "mssql_firewall_rule" { name = var.application_name - resource_type = "azurerm_sql_firewall_rule" + resource_type = "mssql_firewall_rule" suffixes = [var.environment] } # This rule is to enable the 'Allow access to Azure services' checkbox -resource "azurerm_sql_firewall_rule" "database" { - name = azurecaf_name.sql_firewall_rule.result - resource_group_name = var.resource_group - server_name = azurerm_mssql_server.database.name - start_ip_address = "0.0.0.0" - end_ip_address = "0.0.0.0" +resource "azurerm_mssql_firewall_rule" "database" { + name = azurecaf_name.mssql_firewall_rule.result + server_id = azurerm_mssql_server.database.id + start_ip_address = "0.0.0.0" + end_ip_address = "0.0.0.0" } diff --git a/rest-server/src/test/resources/nubesgen/terraform/asa-sqlserver-java/terraform/modules/sql-server/main.tf b/rest-server/src/test/resources/nubesgen/terraform/asa-sqlserver-java/terraform/modules/sql-server/main.tf index 5dd5b5add..19f97e89b 100644 --- a/rest-server/src/test/resources/nubesgen/terraform/asa-sqlserver-java/terraform/modules/sql-server/main.tf +++ b/rest-server/src/test/resources/nubesgen/terraform/asa-sqlserver-java/terraform/modules/sql-server/main.tf @@ -50,17 +50,16 @@ resource "azurerm_mssql_database" "database" { auto_pause_delay_in_minutes = 60 } -resource "azurecaf_name" "sql_firewall_rule" { +resource "azurecaf_name" "mssql_firewall_rule" { name = var.application_name - resource_type = "azurerm_sql_firewall_rule" + resource_type = "mssql_firewall_rule" suffixes = [var.environment] } # This rule is to enable the 'Allow access to Azure services' checkbox -resource "azurerm_sql_firewall_rule" "database" { - name = azurecaf_name.sql_firewall_rule.result - resource_group_name = var.resource_group - server_name = azurerm_mssql_server.database.name - start_ip_address = "0.0.0.0" - end_ip_address = "0.0.0.0" +resource "azurerm_mssql_firewall_rule" "database" { + name = azurecaf_name.mssql_firewall_rule.result + server_id = azurerm_mssql_server.database.id + start_ip_address = "0.0.0.0" + end_ip_address = "0.0.0.0" } diff --git a/rest-server/src/test/resources/nubesgen/terraform/sql-server/terraform/modules/sql-server/main.tf b/rest-server/src/test/resources/nubesgen/terraform/sql-server/terraform/modules/sql-server/main.tf index 5dd5b5add..19f97e89b 100644 --- a/rest-server/src/test/resources/nubesgen/terraform/sql-server/terraform/modules/sql-server/main.tf +++ b/rest-server/src/test/resources/nubesgen/terraform/sql-server/terraform/modules/sql-server/main.tf @@ -50,17 +50,16 @@ resource "azurerm_mssql_database" "database" { auto_pause_delay_in_minutes = 60 } -resource "azurecaf_name" "sql_firewall_rule" { +resource "azurecaf_name" "mssql_firewall_rule" { name = var.application_name - resource_type = "azurerm_sql_firewall_rule" + resource_type = "mssql_firewall_rule" suffixes = [var.environment] } # This rule is to enable the 'Allow access to Azure services' checkbox -resource "azurerm_sql_firewall_rule" "database" { - name = azurecaf_name.sql_firewall_rule.result - resource_group_name = var.resource_group - server_name = azurerm_mssql_server.database.name - start_ip_address = "0.0.0.0" - end_ip_address = "0.0.0.0" +resource "azurerm_mssql_firewall_rule" "database" { + name = azurecaf_name.mssql_firewall_rule.result + server_id = azurerm_mssql_server.database.id + start_ip_address = "0.0.0.0" + end_ip_address = "0.0.0.0" }