Skip to content

Commit

Permalink
Fix private endpoint deployment for aoai
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinbuss committed Aug 23, 2024
1 parent d6ca2d6 commit 2b5973c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/infra/aoai.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ module "azure_open_ai" {
cognitive_account_outbound_network_access_restricted = true
cognitive_account_outbound_network_access_allowed_fqdns = []
cognitive_account_deployments = {}
diagnostics_configurations = []
subnet_id = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/tfmdltst-dev-rg/providers/Microsoft.Network/virtualNetworks/tfmdltst-dev-vnet/subnets/PrivateEndpoints"
diagnostics_configurations = local.diagnostics_configurations
subnet_id = azapi_resource.subnet_private_endpoints.id
connectivity_delay_in_seconds = 0
private_dns_zone_id_cognitive_account = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.cognitiveservices.azure.com"
customer_managed_key = null
private_dns_zone_id_cognitive_account = var.private_dns_zone_id_open_ai
customer_managed_key = local.customer_managed_key
}

resource "azurerm_cognitive_deployment" "cognitive_deployment_gpt_4o" {
Expand Down
11 changes: 11 additions & 0 deletions code/infra/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,14 @@ variable "private_dns_zone_id_bot_framework_token" {
error_message = "Please specify a valid resource ID for the private DNS Zone."
}
}

variable "private_dns_zone_id_open_ai" {
description = "Specifies the resource ID of the private DNS zone for Azure Open AI. Not required if DNS A-records get created via Azure Policy."
type = string
sensitive = false
default = ""
validation {
condition = var.private_dns_zone_id_open_ai == "" || (length(split("/", var.private_dns_zone_id_cognitive_account)) == 9 && endswith(var.private_dns_zone_id_open_ai, "privatelink.openai.azure.com"))
error_message = "Please specify a valid resource ID for the private DNS Zone."
}
}
1 change: 1 addition & 0 deletions config/PerfectThymeTech/vars.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ private_dns_zone_id_vault = "/subscriptions/8f171ff9-2b5b-4f0
private_dns_zone_id_sites = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.azurewebsites.net"
private_dns_zone_id_bot_framework_directline = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.directline.botframework.com"
private_dns_zone_id_bot_framework_token = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.token.botframework.com"
private_dns_zone_id_open_ai = "/subscriptions/8f171ff9-2b5b-4f0f-aed5-7fa360a1d094/resourceGroups/mycrp-prd-global-dns/providers/Microsoft.Network/privateDnsZones/privatelink.openai.azure.com"

0 comments on commit 2b5973c

Please sign in to comment.