Skip to content

googleDialogflowCxEnvironment

Represents an environment for an agent. You can create multiple versions of your agent and publish them to separate environments. When you edit an agent, you are editing the draft agent. At any point, you can save the draft agent as an agent version, which is an immutable snapshot of your agent. When you save the draft agent, it is published to the default environment. When you create agent versions, you can publish them to custom environments. You can create a variety of custom environments for testing, development, production, etc.

To get more information about Environment, see:

Example Usage - Dialogflowcx Environment Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleDialogflowCxAgentAgent =
  new google.dialogflowCxAgent.DialogflowCxAgent(this, "agent", {
    avatar_uri:
      "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
    default_language_code: "en",
    description: "Example description.",
    display_name: "dialogflowcx-agent",
    enable_spell_correction: true,
    enable_stackdriver_logging: true,
    location: "global",
    speech_to_text_settings: [
      {
        enable_speech_adaptation: true,
      },
    ],
    supported_language_codes: ["fr", "de", "es"],
    time_zone: "America/New_York",
  });
const googleDialogflowCxVersionVersion1 =
  new google.dialogflowCxVersion.DialogflowCxVersion(this, "version_1", {
    description: "version 1.0.0",
    display_name: "1.0.0",
    parent: googleDialogflowCxAgentAgent.startFlow,
  });
new google.dialogflowCxEnvironment.DialogflowCxEnvironment(
  this,
  "development",
  {
    description: "Development Environment",
    display_name: "Development",
    parent: googleDialogflowCxAgentAgent.id,
    version_configs: [
      {
        version: googleDialogflowCxVersionVersion1.id,
      },
    ],
  }
);

Argument Reference

The following arguments are supported:

  • displayName - (Required) The human-readable name of the environment (unique in an agent). Limit of 64 characters.

  • versionConfigs - (Required) A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned. Structure is documented below.

The versionConfigs block supports:

  • version - (Required) Format: projects/{{project}}/locations/{{location}}/agents/{{agent}}/flows/{{flow}}/versions/{{version}}.

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

  • parent - (Optional) The Agent to create an Environment for. Format: projects//locations//agents/.

Attributes Reference

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

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

  • name - The name of the environment.

  • updateTime - Update time of this environment. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

  • create - Default is 40 minutes.
  • update - Default is 40 minutes.
  • delete - Default is 20 minutes.

Import

Environment can be imported using any of these accepted formats:

$ terraform import google_dialogflow_cx_environment.default {{parent}}/environments/{{name}}
$ terraform import google_dialogflow_cx_environment.default {{parent}}/{{name}}