You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: google/services/dialogflowcx/resource_dialogflow_cx_agent.go
+85Lines changed: 85 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -355,6 +355,25 @@ These settings affect:
355
355
Computed: true,
356
356
Description: `Name of the start flow in this agent. A start flow will be automatically created when the agent is created, and can only be deleted by deleting the agent. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.`,
357
357
},
358
+
"delete_chat_engine_on_destroy": {
359
+
Type: schema.TypeBool,
360
+
Optional: true,
361
+
Description: `If set to 'true', Terraform will delete the chat engine associated with the agent when the agent is destroyed.
362
+
Otherwise, the chat engine will persist.
363
+
364
+
This virtual field addresses a critical dependency chain: 'agent' -> 'engine' -> 'data store'. The chat engine is automatically
365
+
provisioned when a data store is linked to the agent, meaning Terraform doesn't have direct control over its lifecycle as a managed
366
+
resource. This creates a problem when both the agent and data store are managed by Terraform and need to be destroyed. Without
367
+
delete_chat_engine_on_destroy set to true, the data store's deletion would fail because the unmanaged chat engine would still be
368
+
using it. This setting ensures that the entire dependency chain can be properly torn down.
369
+
See 'mmv1/templates/terraform/examples/dialogflowcx_tool_data_store.tf.tmpl' as an example.
370
+
371
+
Data store can be linked to an agent through the 'knowledgeConnectorSettings' field of a [flow](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.flows#resource:-flow)
372
+
or a [page](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.flows.pages#resource:-page)
373
+
or the 'dataStoreSpec' field of a [tool](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.tools#resource:-tool).
374
+
The ID of the implicitly created engine is stored in the 'genAppBuilderSettings' field of the [agent](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents#resource:-agent).`,
375
+
Default: false,
376
+
},
358
377
"project": {
359
378
Type: schema.TypeString,
360
379
Optional: true,
@@ -549,6 +568,12 @@ func resourceDialogflowCXAgentRead(d *schema.ResourceData, meta interface{}) err
0 commit comments