From 0c222201230fd0a2d4385358c6912ade33f8d9b5 Mon Sep 17 00:00:00 2001 From: Luca Prete Date: Wed, 8 Apr 2026 10:10:08 +0200 Subject: [PATCH] Update outputs of AI Applications module (#3841) * Update outputs of AI Applications module * Update docs * Update readmes --- modules/ai-applications/README.md | 14 +++++----- modules/ai-applications/outputs.tf | 42 ++++++++++++++++-------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/modules/ai-applications/README.md b/modules/ai-applications/README.md index 1996f9fee..1523b50a0 100644 --- a/modules/ai-applications/README.md +++ b/modules/ai-applications/README.md @@ -336,10 +336,12 @@ module "ai-applications" { | name | description | sensitive | |---|---|:---:| -| [chat_engine_ids](outputs.tf#L17) | The ids of the chat engines created. | | -| [chat_engines](outputs.tf#L25) | The chat engines created. | | -| [data_store_ids](outputs.tf#L30) | The ids of the data stores created. | | -| [data_stores](outputs.tf#L38) | The data stores resources created. | | -| [search_engine_ids](outputs.tf#L43) | The ids of the search engines created. | | -| [search_engines](outputs.tf#L51) | The search engines created. | | +| [chat_agent](outputs.tf#L17) | The (Dialogflow CX) chat agent object. | | +| [chat_agent_id](outputs.tf#L22) | The id of the (Dialogflow CX) chat agent. | | +| [chat_engine](outputs.tf#L27) | The chat engine object. | | +| [chat_engine_id](outputs.tf#L32) | The id of the chat engine. | | +| [data_store_ids](outputs.tf#L37) | The ids of the data stores created. | | +| [data_stores](outputs.tf#L45) | The data stores resources created. | | +| [search_engine](outputs.tf#L50) | The search engines object. | | +| [search_engine_id](outputs.tf#L55) | The id of the search engine. | | diff --git a/modules/ai-applications/outputs.tf b/modules/ai-applications/outputs.tf index 10ca868b7..217a15579 100644 --- a/modules/ai-applications/outputs.tf +++ b/modules/ai-applications/outputs.tf @@ -1,5 +1,5 @@ /** - * Copyright 2024 Google LLC + * Copyright 2026 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,24 @@ * limitations under the License. */ -output "chat_engine_ids" { - description = "The ids of the chat engines created." - value = { - for k, v in google_discovery_engine_chat_engine.default - : k => v.id - } +output "chat_agent" { + description = "The (Dialogflow CX) chat agent object." + value = try(google_dialogflow_cx_agent.default[0], null) } -output "chat_engines" { - description = "The chat engines created." - value = google_discovery_engine_chat_engine.default +output "chat_agent_id" { + description = "The id of the (Dialogflow CX) chat agent." + value = try(google_dialogflow_cx_agent.default[0].id, null) +} + +output "chat_engine" { + description = "The chat engine object." + value = try(google_discovery_engine_chat_engine.default[0], null) +} + +output "chat_engine_id" { + description = "The id of the chat engine." + value = try(google_discovery_engine_chat_engine.default[0].id, null) } output "data_store_ids" { @@ -40,15 +47,12 @@ output "data_stores" { value = google_discovery_engine_data_store.default } -output "search_engine_ids" { - description = "The ids of the search engines created." - value = { - for k, v in google_discovery_engine_search_engine.default - : k => v.id - } +output "search_engine" { + description = "The search engines object." + value = try(google_discovery_engine_search_engine.default[0], null) } -output "search_engines" { - description = "The search engines created." - value = google_discovery_engine_search_engine.default +output "search_engine_id" { + description = "The id of the search engine." + value = try(google_discovery_engine_search_engine.default[0].id, null) }