UNPKG

@pulumi/aws

Version:

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

218 lines • 8.94 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.User = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an Amazon Connect User resource. For more information see * [Amazon Connect: Getting Started](https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-get-started.html) * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.connect.User("example", { * instanceId: exampleAwsConnectInstance.id, * name: "example", * password: "Password123", * routingProfileId: exampleAwsConnectRoutingProfile.routingProfileId, * securityProfileIds: [exampleAwsConnectSecurityProfile.securityProfileId], * identityInfo: { * firstName: "example", * lastName: "example2", * }, * phoneConfig: { * afterContactWorkTimeLimit: 0, * phoneType: "SOFT_PHONE", * }, * }); * ``` * * ### With hierarchyGroupId * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.connect.User("example", { * instanceId: exampleAwsConnectInstance.id, * name: "example", * password: "Password123", * routingProfileId: exampleAwsConnectRoutingProfile.routingProfileId, * hierarchyGroupId: exampleAwsConnectUserHierarchyGroup.hierarchyGroupId, * securityProfileIds: [exampleAwsConnectSecurityProfile.securityProfileId], * identityInfo: { * firstName: "example", * lastName: "example2", * }, * phoneConfig: { * afterContactWorkTimeLimit: 0, * phoneType: "SOFT_PHONE", * }, * }); * ``` * * ### With identityInfo filled * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.connect.User("example", { * instanceId: exampleAwsConnectInstance.id, * name: "example", * password: "Password123", * routingProfileId: exampleAwsConnectRoutingProfile.routingProfileId, * securityProfileIds: [exampleAwsConnectSecurityProfile.securityProfileId], * identityInfo: { * email: "example@example.com", * firstName: "example", * lastName: "example2", * secondaryEmail: "secondary@example.com", * }, * phoneConfig: { * afterContactWorkTimeLimit: 0, * phoneType: "SOFT_PHONE", * }, * }); * ``` * * ### With phoneConfig phone type as desk phone * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.connect.User("example", { * instanceId: exampleAwsConnectInstance.id, * name: "example", * password: "Password123", * routingProfileId: exampleAwsConnectRoutingProfile.routingProfileId, * securityProfileIds: [exampleAwsConnectSecurityProfile.securityProfileId], * phoneConfig: { * afterContactWorkTimeLimit: 0, * phoneType: "SOFT_PHONE", * }, * }); * ``` * * ### With multiple Security profile ids specified in securityProfileIds * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.connect.User("example", { * instanceId: exampleAwsConnectInstance.id, * name: "example", * password: "Password123", * routingProfileId: exampleAwsConnectRoutingProfile.routingProfileId, * securityProfileIds: [ * exampleAwsConnectSecurityProfile.securityProfileId, * example2.securityProfileId, * ], * phoneConfig: { * afterContactWorkTimeLimit: 0, * autoAccept: false, * deskPhoneNumber: "+112345678912", * phoneType: "DESK_PHONE", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import Amazon Connect Users using the `instance_id` and `user_id` separated by a colon (`:`). For example: * * ```sh * $ pulumi import aws:connect/user:User example f1288a1f-6193-445a-b47e-af739b2:c1d4e5f6-1b3c-1b3c-1b3c-c1d4e5f6c1d4e5 * ``` */ class User extends pulumi.CustomResource { /** * Get an existing User 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 User(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of User. 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'] === User.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["directoryUserId"] = state ? state.directoryUserId : undefined; resourceInputs["hierarchyGroupId"] = state ? state.hierarchyGroupId : undefined; resourceInputs["identityInfo"] = state ? state.identityInfo : undefined; resourceInputs["instanceId"] = state ? state.instanceId : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["password"] = state ? state.password : undefined; resourceInputs["phoneConfig"] = state ? state.phoneConfig : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["routingProfileId"] = state ? state.routingProfileId : undefined; resourceInputs["securityProfileIds"] = state ? state.securityProfileIds : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["userId"] = state ? state.userId : undefined; } else { const args = argsOrState; if ((!args || args.instanceId === undefined) && !opts.urn) { throw new Error("Missing required property 'instanceId'"); } if ((!args || args.phoneConfig === undefined) && !opts.urn) { throw new Error("Missing required property 'phoneConfig'"); } if ((!args || args.routingProfileId === undefined) && !opts.urn) { throw new Error("Missing required property 'routingProfileId'"); } if ((!args || args.securityProfileIds === undefined) && !opts.urn) { throw new Error("Missing required property 'securityProfileIds'"); } resourceInputs["directoryUserId"] = args ? args.directoryUserId : undefined; resourceInputs["hierarchyGroupId"] = args ? args.hierarchyGroupId : undefined; resourceInputs["identityInfo"] = args ? args.identityInfo : undefined; resourceInputs["instanceId"] = args ? args.instanceId : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["password"] = (args === null || args === void 0 ? void 0 : args.password) ? pulumi.secret(args.password) : undefined; resourceInputs["phoneConfig"] = args ? args.phoneConfig : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["routingProfileId"] = args ? args.routingProfileId : undefined; resourceInputs["securityProfileIds"] = args ? args.securityProfileIds : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["userId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'aws:connect/user:User'; //# sourceMappingURL=user.js.map