Google Dialogflow CX Agent

This page shows how to write Terraform for Dialogflow CX Agent and write them securely.

google_dialogflow_cx_agent (Terraform)

The Agent in Dialogflow CX can be configured in Terraform with the resource name google_dialogflow_cx_agent. The following sections describe 2 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L4
resource "google_dialogflow_cx_agent" "full_agent" {
  display_name               = "us-dev-abcd-fghi-dialogflowcx-agent1"
  location                   = "us-central1"
  project                    = "airline1-sabre-wolverine"
  default_language_code      = "en"
  supported_language_codes   = ["fr", "de", "es"]
main.tf#L1
resource "google_dialogflow_cx_agent" "agent" {
  display_name = "dialogflowcx-agent-1"
  location = "global"
  default_language_code = "en"
  supported_language_codes = ["fr","de","es"]
  time_zone = "America/New_York"

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • location - (Required) The name of the location this agent is located in.

    Note: The first time you are deploying an Agent in your project you must configure location settings. This is a one time step but at the moment you can only configure location settings via the Dialogflow CX console. Another options is to use global location so you don't need to manually configure location settings.

  • display_name - (Required) The human-readable name of the agent, unique within the location.

  • default_language_code - (Required) The default language of the agent as a language tag. See Language Support for a list of the currently supported language codes. This field cannot be updated after creation.

  • time_zone - (Required) The time zone of this agent from the time zone database, e.g., America/New_York, Europe/Paris.


  • supported_language_codes - (Optional) The list of all languages supported by this agent (except for the default_language_code).

  • description - (Optional) The description of this agent. The maximum length is 500 characters. If exceeded, the request is rejected.

  • avatar_uri - (Optional) The URI of the agent's avatar. Avatars are used throughout the Dialogflow console and in the self-hosted Web Demo integration.

  • speech_to_text_settings - (Optional) Settings related to speech recognition. Structure is documented below.

  • security_settings - (Optional) Name of the SecuritySettings reference for the agent. Format: projects/<Project ID>/locations/<Location ID>/securitySettings/<Security Settings ID>.

  • enable_stackdriver_logging - (Optional) Determines whether this agent should log conversation queries.

  • enable_spell_correction - (Optional) Indicates if automatic spell correction is enabled in detect intent requests.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The speech_to_text_settings block supports:

  • enable_speech_adaptation - (Optional) Whether to use speech adaptation for speech recognition.

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/[[project]]/locations/[[location]]/agents/[[name]]

  • name - The unique identifier of the agent.

  • start_flow - 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>.

Explanation in Terraform Registry

Agents are best described as Natural Language Understanding (NLU) modules that transform user requests into actionable data. You can include agents in your app, product, or service to determine user intent and respond to the user in a natural way. To get more information about Agent, see:

Frequently asked questions

What is Google Dialogflow CX Agent?

Google Dialogflow CX Agent is a resource for Dialogflow CX of Google Cloud Platform. Settings can be wrote in Terraform.

Where can I find the example code for the Google Dialogflow CX Agent?

For Terraform, the rajeevkghosh/dialogflow-tf-code and looklikegarfield/dialogflow_gcp source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.