diff --git a/infra/main.tf b/infra/main.tf index cf1c121..03f67d4 100644 --- a/infra/main.tf +++ b/infra/main.tf @@ -136,6 +136,7 @@ module "cog" { content_safety_name = local.content_safety_name speech_name = local.speech_name content_safety_storage_resource_id = module.st.storage_account_id + deploy_bing = var.deploy_bing } module "cae" { diff --git a/infra/modules/cog/main.tf b/infra/modules/cog/main.tf index 6b2faef..7647142 100644 --- a/infra/modules/cog/main.tf +++ b/infra/modules/cog/main.tf @@ -32,7 +32,8 @@ resource "azurerm_cognitive_account" "speech" { } resource "azurerm_resource_group_template_deployment" "main" { - name = var.bing_name + count = var.deploy_bing ? 1 : 0 + name = "${var.bing_name}-${uuid()}" resource_group_name = var.resource_group_name deployment_mode = "Incremental" parameters_content = jsonencode({ diff --git a/infra/modules/cog/outputs.tf b/infra/modules/cog/outputs.tf index e909519..f753c5f 100644 --- a/infra/modules/cog/outputs.tf +++ b/infra/modules/cog/outputs.tf @@ -19,5 +19,5 @@ output "speech_key" { } output "bing_key" { - value = jsondecode(azurerm_resource_group_template_deployment.main.output_content).accessKeys.value.key1 -} \ No newline at end of file + value = var.deploy_bing ? jsondecode(azurerm_resource_group_template_deployment.main.output_content).accessKeys.value.key1 : "" +} diff --git a/infra/modules/cog/variables.tf b/infra/modules/cog/variables.tf index 1c7f916..9b22782 100644 --- a/infra/modules/cog/variables.tf +++ b/infra/modules/cog/variables.tf @@ -5,4 +5,5 @@ variable "content_safety_name" {} variable "cognitive_services_name" {} variable "speech_name" {} variable "bing_name" {} +variable "deploy_bing" {} variable "content_safety_storage_resource_id" {} diff --git a/infra/variables.tf b/infra/variables.tf index 81366d5..18509f6 100644 --- a/infra/variables.tf +++ b/infra/variables.tf @@ -110,6 +110,10 @@ variable "enable_apim" { default = false } +variable "deploy_bing" { + default = false +} + variable "pbi_report_link" { default = "" }