Skip to content

Commit

Permalink
FMT + Outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoDexsph committed Jun 24, 2024
1 parent e342bcf commit 83aa479
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ resource "azurecaf_name" "service" {
}

resource "azurerm_cognitive_account" "service" {
name = azurecaf_name.service.result
location = var.location
resource_group_name = var.resource_group_name
kind = var.settings.kind
sku_name = var.settings.sku_name
name = azurecaf_name.service.result
location = var.location
resource_group_name = var.resource_group_name
kind = var.settings.kind
sku_name = var.settings.sku_name

qna_runtime_endpoint = var.settings.kind == "QnAMaker" ? var.settings.qna_runtime_endpoint : try(var.settings.qna_runtime_endpoint, null)

Expand All @@ -24,7 +24,7 @@ resource "azurerm_cognitive_account" "service" {
identity_ids = can(var.settings.identity.ids) ? var.settings.identity.ids : can(var.settings.identity.key) ? [var.managed_identities[try(var.settings.identity.lz_key, var.client_config.landingzone_key)][var.settings.identity.key].id] : null
}
}

dynamic "network_acls" {
for_each = can(var.settings.network_acls) ? [var.settings.network_acls] : []
content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,13 @@ output "id" {
output "endpoint" {
description = "The endpoint used to connect to the Cognitive Service Account."
value = azurerm_cognitive_account.service.endpoint
}

output "rbac_id" {
description = "The Principal ID of the Cognetive Services for Role Mapping"
value = try(azurerm_cognitive_account.service.identity[0].principal_id, null)
}

output "identity" {
value = try(azurerm_cognitive_account.identity, null)
}

0 comments on commit 83aa479

Please sign in to comment.