UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

165 lines 6.89 kB
"use strict"; // *** 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.ContactFlow = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Amazon Connect Contact Flow 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 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 Flows exported from the Console [Contact Flow import/export](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`](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/connect/describe-contact-flow.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 test = new aws.connect.ContactFlow("test", { * instanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111", * name: "Test", * description: "Test Contact Flow Description", * type: "CONTACT_FLOW", * content: JSON.stringify({ * Version: "2019-10-30", * StartAction: "12345678-1234-1234-1234-123456789012", * Actions: [ * { * Identifier: "12345678-1234-1234-1234-123456789012", * Type: "MessageParticipant", * Transitions: { * NextAction: "abcdef-abcd-abcd-abcd-abcdefghijkl", * Errors: [], * Conditions: [], * }, * Parameters: { * Text: "Thanks for calling the sample flow!", * }, * }, * { * Identifier: "abcdef-abcd-abcd-abcd-abcdefghijkl", * Type: "DisconnectParticipant", * Transitions: {}, * Parameters: {}, * }, * ], * }), * tags: { * Name: "Test Contact Flow", * 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 test = new aws.connect.ContactFlow("test", { * instanceId: "aaaaaaaa-bbbb-cccc-dddd-111111111111", * name: "Test", * description: "Test Contact Flow Description", * type: "CONTACT_FLOW", * filename: "contact_flow.json", * contentHash: std.filebase64sha256({ * input: "contact_flow.json", * }).then(invoke => invoke.result), * tags: { * Name: "Test Contact Flow", * Application: "Example", * Method: "Create", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Amazon Connect Contact Flows using the `instance_id` and `contact_flow_id` separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:connect/contactFlow:ContactFlow example f1288a1f-6193-445a-b47e-af739b2:c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5 * ``` */ class ContactFlow extends pulumi.CustomResource { /** * Get an existing ContactFlow 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 ContactFlow(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ContactFlow. 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'] === ContactFlow.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["contactFlowId"] = state?.contactFlowId; 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; resourceInputs["type"] = state?.type; } 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["type"] = args?.type; resourceInputs["arn"] = undefined /*out*/; resourceInputs["contactFlowId"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ContactFlow.__pulumiType, name, resourceInputs, opts); } } exports.ContactFlow = ContactFlow; /** @internal */ ContactFlow.__pulumiType = 'aws:connect/contactFlow:ContactFlow'; //# sourceMappingURL=contactFlow.js.map