UNPKG

@pulumi/aws

Version:

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

136 lines 5.07 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.BotAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Allows the specified Amazon Connect instance to access the specified Amazon Lex (V1) bot. For more information see * [Amazon Connect: Getting Started](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-get-started.html) and [Add an Amazon Lex bot](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-lex.html). * * > **NOTE:** This resource only currently supports Amazon Lex (V1) Associations. * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.connect.BotAssociation("example", { * instanceId: exampleAwsConnectInstance.id, * lexBot: { * lexRegion: "us-west-2", * name: "Test", * }, * }); * ``` * * ### Including a sample Lex bot * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegion({}); * const example = new aws.lex.Intent("example", { * createVersion: true, * name: "connect_lex_intent", * fulfillmentActivity: { * type: "ReturnIntent", * }, * sampleUtterances: ["I would like to pick up flowers."], * }); * const exampleBot = new aws.lex.Bot("example", { * abortStatement: { * messages: [{ * content: "Sorry, I am not able to assist at this time.", * contentType: "PlainText", * }], * }, * clarificationPrompt: { * maxAttempts: 2, * messages: [{ * content: "I didn't understand you, what would you like to do?", * contentType: "PlainText", * }], * }, * intents: [{ * intentName: example.name, * intentVersion: "1", * }], * childDirected: false, * name: "connect_lex_bot", * processBehavior: "BUILD", * }); * const exampleBotAssociation = new aws.connect.BotAssociation("example", { * instanceId: exampleAwsConnectInstance.id, * lexBot: { * lexRegion: current.then(current => current.region), * name: exampleBot.name, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_connect_bot_association` using the Amazon Connect instance ID, Lex (V1) bot name, and Lex (V1) bot region separated by colons (`:`). For example: * * ```sh * $ pulumi import aws:connect/botAssociation:BotAssociation example aaaaaaaa-bbbb-cccc-dddd-111111111111:Example:us-west-2 * ``` */ class BotAssociation extends pulumi.CustomResource { /** * Get an existing BotAssociation 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 BotAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of BotAssociation. 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'] === BotAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["instanceId"] = state?.instanceId; resourceInputs["lexBot"] = state?.lexBot; resourceInputs["region"] = state?.region; } else { const args = argsOrState; if (args?.instanceId === undefined && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if (args?.lexBot === undefined && !opts.urn) { throw new Error("Missing required property 'lexBot'"); } resourceInputs["instanceId"] = args?.instanceId; resourceInputs["lexBot"] = args?.lexBot; resourceInputs["region"] = args?.region; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(BotAssociation.__pulumiType, name, resourceInputs, opts); } } exports.BotAssociation = BotAssociation; /** @internal */ BotAssociation.__pulumiType = 'aws:connect/botAssociation:BotAssociation'; //# sourceMappingURL=botAssociation.js.map