@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
177 lines • 7.51 kB
JavaScript
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContactFlowModule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Amazon Connect Contact Flow Module resource. For more information see
* [Amazon Connect: Getting Started](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-get-started.html)
*
* This resource embeds or references Contact Flows Modules specified in Amazon Connect Contact Flow Language. For more information see
* [Amazon Connect Flow language](https://docs.aws.amazon.com/connect/latest/adminguide/flow-language.html)
*
* !> **WARN:** Contact Flow Modules exported from the Console [See Contact Flow import/export which is the same for Contact Flow Modules](https://docs.aws.amazon.com/connect/latest/adminguide/contact-flow-import-export.html) are not in the Amazon Connect Contact Flow Language and can not be used with this resource. Instead, the recommendation is to use the AWS CLI [`describe-contact-flow-module`](https://docs.aws.amazon.com/cli/latest/reference/connect/describe-contact-flow-module.html).
* See example below which uses `jq` to extract the `Content` attribute and saves it to a local file.
*
* ## Example Usage
*
* ### Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.connect.ContactFlowModule("example", {
* instanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
* name: "Example",
* description: "Example Contact Flow Module Description",
* content: JSON.stringify({
* Version: "2019-10-30",
* StartAction: "12345678-1234-1234-1234-123456789012",
* Actions: [
* {
* Identifier: "12345678-1234-1234-1234-123456789012",
* Parameters: {
* Text: "Hello contact flow module",
* },
* Transitions: {
* NextAction: "abcdef-abcd-abcd-abcd-abcdefghijkl",
* Errors: [],
* Conditions: [],
* },
* Type: "MessageParticipant",
* },
* {
* Identifier: "abcdef-abcd-abcd-abcd-abcdefghijkl",
* Type: "DisconnectParticipant",
* Parameters: {},
* Transitions: {},
* },
* ],
* Settings: {
* InputParameters: [],
* OutputParameters: [],
* Transitions: [
* {
* DisplayName: "Success",
* ReferenceName: "Success",
* Description: "",
* },
* {
* DisplayName: "Error",
* ReferenceName: "Error",
* Description: "",
* },
* ],
* },
* }),
* tags: {
* Name: "Example Contact Flow Module",
* Application: "Example",
* Method: "Create",
* },
* });
* ```
*
* ### With External Content
*
* Use the AWS CLI to extract Contact Flow Content:
*
* Use the generated file as input:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as std from "@pulumi/std";
*
* const example = new aws.connect.ContactFlowModule("example", {
* instanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111",
* name: "Example",
* description: "Example Contact Flow Module Description",
* filename: "contact_flow_module.json",
* contentHash: std.filebase64sha256({
* input: "contact_flow_module.json",
* }).then(invoke => invoke.result),
* tags: {
* Name: "Example Contact Flow Module",
* Application: "Example",
* Method: "Create",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Amazon Connect Contact Flow Modules using the `instance_id` and `contact_flow_module_id` separated by a colon (`:`). For example:
*
* ```sh
* $ pulumi import aws:connect/contactFlowModule:ContactFlowModule example f1288a1f-6193-445a-b47e-af739b2:c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5
* ```
*/
class ContactFlowModule extends pulumi.CustomResource {
/**
* Get an existing ContactFlowModule resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new ContactFlowModule(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ContactFlowModule. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === ContactFlowModule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["contactFlowModuleId"] = state?.contactFlowModuleId;
resourceInputs["content"] = state?.content;
resourceInputs["contentHash"] = state?.contentHash;
resourceInputs["description"] = state?.description;
resourceInputs["filename"] = state?.filename;
resourceInputs["instanceId"] = state?.instanceId;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.instanceId === undefined && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
resourceInputs["content"] = args?.content;
resourceInputs["contentHash"] = args?.contentHash;
resourceInputs["description"] = args?.description;
resourceInputs["filename"] = args?.filename;
resourceInputs["instanceId"] = args?.instanceId;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["contactFlowModuleId"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ContactFlowModule.__pulumiType, name, resourceInputs, opts);
}
}
exports.ContactFlowModule = ContactFlowModule;
/** @internal */
ContactFlowModule.__pulumiType = 'aws:connect/contactFlowModule:ContactFlowModule';
//# sourceMappingURL=contactFlowModule.js.map
;