Skip to content

Commit

Permalink
fix: Wrong private endpoint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dploeger committed May 5, 2022
1 parent 471abc0 commit 577cf74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firewall.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ resource "azurerm_postgresql_virtual_network_rule" "virtualnetworks" {
}

resource "azurerm_private_endpoint" "postgresql-private-endpoint" {
for_each = !var.database_flexible && var.public_access == true ? var.subnets : {}
name = "${each.value}-postgresql-${azurerm_postgresql_server.server.0.id}-endpoint"
for_each = !var.database_flexible && var.public_access == false ? var.subnets : {}
name = "${each.key}${azurerm_postgresql_server.server.0.name}"
location = var.location
resource_group_name = var.resource_group
subnet_id = each.value

private_service_connection {
name = "${each.value}-postgresql-${azurerm_postgresql_server.server.0.id}-privateserviceconnection"
name = "${each.key}${azurerm_postgresql_server.server.0.name}"
private_connection_resource_id = azurerm_postgresql_server.server.0.id
subresource_names = ["mysqlServer"]
subresource_names = ["postgresqlServer"]
is_manual_connection = false
}
}

0 comments on commit 577cf74

Please sign in to comment.