| --- |
| # ---------------------------------------------------------------------------- |
| # |
| # *** AUTO GENERATED CODE *** Type: MMv1 *** |
| # |
| # ---------------------------------------------------------------------------- |
| # |
| # This file is automatically generated by Magic Modules and manual |
| # changes will be clobbered when the file is regenerated. |
| # |
| # Please read more about how to change this file in |
| # .github/CONTRIBUTING.md. |
| # |
| # ---------------------------------------------------------------------------- |
| subcategory: "Dialogflow CX" |
| description: |- |
| An intent represents a user's intent to interact with a conversational agent. |
| --- |
| |
| # google_dialogflow_cx_intent |
| |
| An intent represents a user's intent to interact with a conversational agent. |
| |
| |
| To get more information about Intent, see: |
| |
| * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.intents) |
| * How-to Guides |
| * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs) |
| |
| <div class = "oics-button" style="float: right; margin: 0 0 -15px"> |
| <a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md&cloudshell_working_dir=dialogflowcx_intent_full&open_in_editor=main.tf" target="_blank"> |
| <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;"> |
| </a> |
| </div> |
| ## Example Usage - Dialogflowcx Intent Full |
| |
| |
| ```hcl |
| resource "google_dialogflow_cx_agent" "agent" { |
| display_name = "dialogflowcx-agent" |
| location = "global" |
| default_language_code = "en" |
| supported_language_codes = ["fr","de","es"] |
| time_zone = "America/New_York" |
| description = "Example description." |
| avatar_uri = "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png" |
| enable_stackdriver_logging = true |
| enable_spell_correction = true |
| speech_to_text_settings { |
| enable_speech_adaptation = true |
| } |
| } |
| |
| |
| resource "google_dialogflow_cx_intent" "basic_intent" { |
| parent = google_dialogflow_cx_agent.agent.id |
| display_name = "Example" |
| priority = 1 |
| description = "Intent example" |
| training_phrases { |
| parts { |
| text = "training" |
| } |
| |
| parts { |
| text = "phrase" |
| } |
| |
| parts { |
| text = "example" |
| } |
| |
| repeat_count = 1 |
| } |
| |
| parameters { |
| id = "param1" |
| entity_type = "projects/-/locations/-/agents/-/entityTypes/sys.date" |
| } |
| |
| labels = { |
| label1 = "value1", |
| label2 = "value2" |
| } |
| } |
| ``` |
| |
| ## Argument Reference |
| |
| The following arguments are supported: |
| |
| |
| * `display_name` - |
| (Required) |
| The human-readable name of the intent, unique within the agent. |
| |
| |
| - - - |
| |
| |
| * `training_phrases` - |
| (Optional) |
| The collection of training phrases the agent is trained on to identify the intent. |
| Structure is [documented below](#nested_training_phrases). |
| |
| * `parameters` - |
| (Optional) |
| The collection of parameters associated with the intent. |
| Structure is [documented below](#nested_parameters). |
| |
| * `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. Currently only default fallback intent is allowed in the agent, which is added upon agent creation. |
| Adding training phrases to fallback intent is useful in the case of requests that are mistakenly matched, since training phrases assigned to fallback intents act as negative examples that triggers no-match event. |
| To manage the fallback intent, set `is_default_negative_intent = true` |
| |
| * `labels` - |
| (Optional) |
| The key/value metadata to label an intent. Labels can contain lowercase letters, digits and the symbols '-' and '_'. International characters are allowed, including letters from unicase alphabets. Keys must start with a letter. Keys and values can be no longer than 63 characters and no more than 128 bytes. |
| Prefix "sys-" is reserved for Dialogflow defined labels. Currently allowed Dialogflow defined labels include: * sys-head * sys-contextual The above labels do not require value. "sys-head" means the intent is a head intent. "sys.contextual" means the intent is a contextual intent. |
| An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }. |
| |
| **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. |
| Please refer to the field `effective_labels` for all of the labels present on the resource. |
| |
| * `description` - |
| (Optional) |
| Human readable description for better understanding an intent like its scope, content, result etc. Maximum character limit: 140 characters. |
| |
| * `parent` - |
| (Optional) |
| The agent to create an intent for. |
| Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>. |
| |
| * `language_code` - |
| (Optional) |
| The language of the following fields in intent: |
| Intent.training_phrases.parts.text |
| If not specified, the agent's default language is used. Many languages are supported. Note: languages must be enabled in the agent before they can be used. |
| |
| * `is_default_welcome_intent` - (Optional) Marks this as the [Default Welcome Intent](https://cloud.google.com/dialogflow/cx/docs/concept/intent#welcome) for an agent. When you create an agent, a Default Welcome Intent is created automatically. |
| The Default Welcome Intent cannot be deleted; deleting the `google_dialogflow_cx_intent` resource does nothing to the underlying GCP resources. |
| |
| ~> Avoid having multiple `google_dialogflow_cx_intent` resources linked to the same agent with `is_default_welcome_intent = true` because they will compete to control a single Default Welcome Intent resource in GCP. |
| |
| * `is_default_negative_intent` - (Optional) Marks this as the [Default Negative Intent](https://cloud.google.com/dialogflow/cx/docs/concept/intent#negative) for an agent. When you create an agent, a Default Negative Intent is created automatically. |
| The Default Negative Intent cannot be deleted; deleting the `google_dialogflow_cx_intent` resource does nothing to the underlying GCP resources. |
| |
| ~> Avoid having multiple `google_dialogflow_cx_intent` resources linked to the same agent with `is_default_negative_intent = true` because they will compete to control a single Default Negative Intent resource in GCP. |
| |
| |
| <a name="nested_training_phrases"></a>The `training_phrases` block supports: |
| |
| * `id` - |
| (Output) |
| The unique identifier of the training phrase. |
| |
| * `parts` - |
| (Required) |
| The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase. |
| Note: The API does not automatically annotate training phrases like the Dialogflow Console does. |
| Note: Do not forget to include whitespace at part boundaries, so the training phrase is well formatted when the parts are concatenated. |
| If the training phrase does not need to be annotated with parameters, you just need a single part with only the Part.text field set. |
| If you want to annotate the training phrase, you must create multiple parts, where the fields of each part are populated in one of two ways: |
| Part.text is set to a part of the phrase that has no parameters. |
| Part.text is set to a part of the phrase that you want to annotate, and the parameterId field is set. |
| Structure is [documented below](#nested_parts). |
| |
| * `repeat_count` - |
| (Optional) |
| Indicates how many times this example was added to the intent. |
| |
| |
| <a name="nested_parts"></a>The `parts` block supports: |
| |
| * `text` - |
| (Required) |
| The text for this part. |
| |
| * `parameter_id` - |
| (Optional) |
| The parameter used to annotate this part of the training phrase. This field is required for annotated parts of the training phrase. |
| |
| <a name="nested_parameters"></a>The `parameters` block supports: |
| |
| * `id` - |
| (Required) |
| The unique identifier of the parameter. This field is used by training phrases to annotate their parts. |
| |
| * `entity_type` - |
| (Required) |
| The entity type of the parameter. |
| Format: projects/-/locations/-/agents/-/entityTypes/<System Entity Type ID> for system entity types (for example, projects/-/locations/-/agents/-/entityTypes/sys.date), or projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type ID> for developer entity types. |
| |
| * `is_list` - |
| (Optional) |
| Indicates whether the parameter represents a list of values. |
| |
| * `redact` - |
| (Optional) |
| Indicates whether the parameter content should be redacted in log. If redaction is enabled, the parameter content will be replaced by parameter name during logging. |
| Note: the parameter content is subject to redaction if either parameter level redaction or entity type level redaction is enabled. |
| |
| ## Attributes Reference |
| |
| In addition to the arguments listed above, the following computed attributes are exported: |
| |
| * `id` - an identifier for the resource with format `{{parent}}/intents/{{name}}` |
| |
| * `name` - |
| The unique identifier of the intent. |
| Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>. |
| |
| * `terraform_labels` - |
| The combination of labels configured directly on the resource |
| and default labels configured on the provider. |
| |
| * `effective_labels` - |
| All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Terraform, other clients and services. |
| |
| |
| ## Timeouts |
| |
| This resource provides the following |
| [Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options: |
| |
| - `create` - Default is 40 minutes. |
| - `update` - Default is 40 minutes. |
| - `delete` - Default is 20 minutes. |
| |
| ## Import |
| |
| |
| Intent can be imported using any of these accepted formats: |
| |
| * `{{parent}}/intents/{{name}}` |
| * `{{parent}}/{{name}}` |
| |
| |
| In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Intent using one of the formats above. For example: |
| |
| ```tf |
| import { |
| id = "{{parent}}/intents/{{name}}" |
| to = google_dialogflow_cx_intent.default |
| } |
| ``` |
| |
| When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Intent can be imported using one of the formats above. For example: |
| |
| ``` |
| $ terraform import google_dialogflow_cx_intent.default {{parent}}/intents/{{name}} |
| $ terraform import google_dialogflow_cx_intent.default {{parent}}/{{name}} |
| ``` |