Cx Environment
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:
How-to Guides
Example Usage
Dialogflowcx Environment Full
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.diagflow.CxAgent;
import com.pulumi.gcp.diagflow.CxAgentArgs;
import com.pulumi.gcp.diagflow.inputs.CxAgentSpeechToTextSettingsArgs;
import com.pulumi.gcp.diagflow.CxVersion;
import com.pulumi.gcp.diagflow.CxVersionArgs;
import com.pulumi.gcp.diagflow.CxEnvironment;
import com.pulumi.gcp.diagflow.CxEnvironmentArgs;
import com.pulumi.gcp.diagflow.inputs.CxEnvironmentVersionConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var agent = new CxAgent("agent", CxAgentArgs.builder()
.displayName("dialogflowcx-agent")
.location("global")
.defaultLanguageCode("en")
.supportedLanguageCodes(
"fr",
"de",
"es")
.timeZone("America/New_York")
.description("Example description.")
.avatarUri("https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png")
.enableStackdriverLogging(true)
.enableSpellCorrection(true)
.speechToTextSettings(CxAgentSpeechToTextSettingsArgs.builder()
.enableSpeechAdaptation(true)
.build())
.build());
var version1 = new CxVersion("version1", CxVersionArgs.builder()
.parent(agent.startFlow())
.displayName("1.0.0")
.description("version 1.0.0")
.build());
var development = new CxEnvironment("development", CxEnvironmentArgs.builder()
.parent(agent.id())
.displayName("Development")
.description("Development Environment")
.versionConfigs(CxEnvironmentVersionConfigArgs.builder()
.version(version1.id())
.build())
.build());
}
}
Import
Environment can be imported using any of these accepted formats
$ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/environments/{{name}}
$ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/{{name}}
Properties
The human-readable description of the environment. The maximum length is 500 characters. If exceeded, the request is rejected.
The human-readable name of the environment (unique in an agent). Limit of 64 characters.
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".
A list of configurations for flow versions. You should include version configs for all flows that are reachable from Agent.start_flow in the agent. Otherwise, an error will be returned. Structure is documented below.