Skip to content

Commit

Permalink
fix private dns counts
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Jan 5, 2024
1 parent 26feb19 commit 456cf1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions terraform/clouds/azure/postgres.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ resource "random_password" "password" {

resource "azurerm_private_dns_zone" "postgres" {
count = var.create_db ? 1 : 0

name = "plrl.database.azure.com"
resource_group_name = local.resource_group.name
}

resource "azurerm_private_dns_zone_virtual_network_link" "postgres" {
count = var.create_db ? 1 : 0

name = "plrl.postgres.com"
private_dns_zone_name = azurerm_private_dns_zone.postgres.name
private_dns_zone_name = azurerm_private_dns_zone.postgres[0].name
virtual_network_id = azurerm_virtual_network.network.id
resource_group_name = local.resource_group.name
}
Expand All @@ -27,7 +29,7 @@ resource "azurerm_postgresql_flexible_server" "postgres" {
location = local.resource_group.location
version = "13"
delegated_subnet_id = azurerm_subnet.postgres.id
private_dns_zone_id = azurerm_private_dns_zone.postgres.id
private_dns_zone_id = azurerm_private_dns_zone.postgres[0].id
administrator_login = "console"
administrator_password = random_password.password.result
zone = "1"
Expand Down

0 comments on commit 456cf1f

Please sign in to comment.