» google_dialogflow_intent

Represents a Dialogflow intent. Intents convert a number of user expressions or patterns into an action. An action is an extraction of a user command or sentence semantics.

To get more information about Intent, see:

» Example Usage - Dialogflow Intent Basic

resource "google_dialogflow_agent" "basic_agent" {
  display_name = "example_agent"
  default_language_code = "en"
  time_zone = "America/New_York"
}

resource "google_dialogflow_intent" "basic_intent" {
  depends_on = [google_dialogflow_agent.basic_agent]
  display_name = "basic-intent"
}

» Example Usage - Dialogflow Intent Full

resource "google_project" "agent_project" {
  project_id = "tf-test-dialogflow-%{random_suffix}"
  name = "tf-test-dialogflow-%{random_suffix}"
  org_id = "123456789"
}

resource "google_project_service" "agent_project" {
  project = google_project.agent_project.project_id
  service = "dialogflow.googleapis.com"
  disable_dependent_services = false
}

resource "google_service_account" "dialogflow_service_account" {
  account_id = "tf-test-dialogflow-%{random_suffix}"
}

resource "google_project_iam_member" "agent_create" {
  project = google_project_service.agent_project.project
  role    = "roles/dialogflow.admin"
  member  = "serviceAccount:${google_service_account.dialogflow_service_account.email}"
}

resource "google_dialogflow_agent" "basic_agent" {
  project = google_project.agent_project.project_id
  display_name = "example_agent"
  default_language_code = "en"
  time_zone = "America/New_York"
}

resource "google_dialogflow_intent" "full_intent" {
  project = google_project.agent_project.project_id
  depends_on = [google_dialogflow_agent.basic_agent]
  display_name = "full-intent"
  webhook_state = "WEBHOOK_STATE_ENABLED"
  priority = 1
  is_fallback = false
  ml_disabled = true
  action = "some_action"
  reset_contexts = true
  input_context_names = ["projects/${google_project.agent_project.project_id}/agent/sessions/-/contexts/some_id"]
  events = ["some_event"]
  default_response_platforms = ["FACEBOOK","SLACK"]
}

» Argument Reference

The following arguments are supported:

  • display_name - (Required) The name of this intent to be displayed on the console.

  • webhook_state - (Optional) Indicates whether webhooks are enabled for the intent.

    • WEBHOOK_STATE_ENABLED: Webhook is enabled in the agent and in the intent.
    • WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING: Webhook is enabled in the agent and in the intent. Also, each slot filling prompt is forwarded to the webhook. Possible values are WEBHOOK_STATE_ENABLED and WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING.
  • priority - (Optional) The priority of this intent. Higher numbers represent higher priorities.

    • If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds to the Normal priority in the console.
    • If the supplied value is negative, the intent is ignored in runtime detect intent requests.
  • is_fallback - (Optional) Indicates whether this is a fallback intent.

  • ml_disabled - (Optional) Indicates whether Machine Learning is disabled for the intent. Note: If mlDisabled setting is set to true, then this intent is not taken into account during inference in ML ONLY match mode. Also, auto-markup in the UI is turned off.

  • input_context_names - (Optional) The list of context names required for this intent to be triggered. Format: projects//agent/sessions/-/contexts/.

  • events - (Optional) The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of the contexts must be present in the active user session for an event to trigger this intent. See the events reference for more details.

  • action - (Optional) The name of the action associated with the intent. Note: The action name must not contain whitespaces.

  • reset_contexts - (Optional) Indicates whether to delete all contexts in the current session when this intent is matched.

  • default_response_platforms - (Optional) The list of platforms for which the first responses will be copied from the messages in PLATFORM_UNSPECIFIED (i.e. default platform). Each value may be one of FACEBOOK, SLACK, TELEGRAM, KIK, SKYPE, LINE, VIBER, ACTIONS_ON_GOOGLE, and GOOGLE_HANGOUTS.

  • parent_followup_intent_name - (Optional) The unique identifier of the parent intent in the chain of followup intents. Format: projects//agent/intents/.

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

» Attributes Reference

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

  • id - an identifier for the resource with format {{name}}

  • name - The unique identifier of this intent. Format: projects//agent/intents/.

  • root_followup_intent_name - The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup intents chain for this intent. Format: projects//agent/intents/.

  • followup_intent_info - Information about all followup intents that have this intent as a direct or indirect parent. We populate this field only in the output. Structure is documented below.

The followup_intent_info block contains:

  • followup_intent_name - (Optional) The unique identifier of the followup intent. Format: projects//agent/intents/.

  • parent_followup_intent_name - (Optional) The unique identifier of the followup intent's parent. Format: projects//agent/intents/.

» Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • update - Default is 4 minutes.
  • delete - Default is 4 minutes.

» Import

Intent can be imported using any of these accepted formats:

$ terraform import google_dialogflow_intent.default {{name}}

» User Project Overrides

This resource supports User Project Overrides.