Skip to content

Commit

Permalink
feat: add private endpoint to submigrations selfcare function
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-calabrese committed Aug 6, 2024
1 parent 0ea6a59 commit 7df2541
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/domains/selfcare/_modules/app_services/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,8 @@ data "azurerm_storage_account" "assets_cdn" {
name = replace("${var.project}-stcdnassets", "-", "")
resource_group_name = local.resource_group_name_common
}

data "azurerm_private_dns_zone" "function_app" {
name = "privatelink.azurewebsites.net"
resource_group_name = local.resource_group_name_common
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,45 @@ module "function_subscriptionmigrations_staging_slot" {

tags = var.tags
}

resource "azurerm_private_endpoint" "function_sites" {
name = "${var.project}-subsmigrations-fn"
location = var.location
resource_group_name = var.resource_group_name
subnet_id = var.private_endpoint_subnet_id

private_service_connection {
name = "${var.project}-subsmigrations-fn"
private_connection_resource_id = module.function_subscriptionmigrations.id
is_manual_connection = false
subresource_names = ["sites"]
}

private_dns_zone_group {
name = "private-dns-zone-group"
private_dns_zone_ids = [data.azurerm_private_dns_zone.function_app.id]
}

tags = var.tags
}

resource "azurerm_private_endpoint" "staging_function_sites" {
name = "${var.project}-subsmigrations-fn-staging"
location = var.location
resource_group_name = var.resource_group_name
subnet_id = var.private_endpoint_subnet_id

private_service_connection {
name = "${var.project}-subsmigrations-fn-staging"
private_connection_resource_id = module.function_subscriptionmigrations.id
is_manual_connection = false
subresource_names = ["sites-${module.function_subscriptionmigrations.name}"]
}

private_dns_zone_group {
name = "private-dns-zone-group"
private_dns_zone_ids = [data.azurerm_private_dns_zone.function_app.id]
}

tags = var.tags
}

0 comments on commit 7df2541

Please sign in to comment.