Skip to content

Commit

Permalink
try to set up a private service connection for vnet
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljguarino committed Jan 5, 2024
1 parent 81ce5e1 commit 611218c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion terraform/clouds/azure/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module "aks" {
prefix = var.cluster_name
os_disk_size_gb = 60
sku_tier = "Standard"
rbac_aad = true
vnet_subnet_id = azurerm_subnet.network.id
node_pools = {for name, pool in var.node_pools : name => merge({name = name}, pool)}

Expand Down
14 changes: 14 additions & 0 deletions terraform/clouds/azure/postgres.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,18 @@ module "postgresql" {
vnet_rules = [
{ name = "subnet1", subnet_id = azurerm_subnet.network.id }
]
}

resource "azurerm_private_endpoint" "pg" {
name = "${local.resource_group.name}-${local.db_name}"
location = local.resource_group.location
resource_group_name = local.resource_group.name
subnet_id = azurerm_subnet.network.id

private_service_connection {
name = "${local.resource_group.name}-${local.db_name}"
private_connection_resource_id = module.postgresql.server_id
subresource_names = ["postgresqlServer"]
is_manual_connection = false
}
}

0 comments on commit 611218c

Please sign in to comment.