UNPKG

@pulumi/aws

Version:

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

106 lines 4.06 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.UserInGroup = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Adds the specified user to the specified group. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cognito.UserPool("example", { * name: "example", * passwordPolicy: { * temporaryPasswordValidityDays: 7, * minimumLength: 6, * requireUppercase: false, * requireSymbols: false, * requireNumbers: false, * }, * }); * const exampleUser = new aws.cognito.User("example", { * userPoolId: example.id, * username: "example", * }); * const exampleUserGroup = new aws.cognito.UserGroup("example", { * userPoolId: example.id, * name: "example", * }); * const exampleUserInGroup = new aws.cognito.UserInGroup("example", { * userPoolId: example.id, * groupName: exampleUserGroup.name, * username: exampleUser.username, * }); * ``` * * ## Import * * Using `pulumi import`, import a Cognito Group User using a comma-delimited string concatenating the `user_pool_id`, `group_name`, and `username` arguments. For example: * * ```sh * $ pulumi import aws:cognito/userInGroup:UserInGroup example us-east-1_vG78M4goG,example-group,example-user * ``` */ class UserInGroup extends pulumi.CustomResource { /** * Get an existing UserInGroup 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 UserInGroup(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of UserInGroup. 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'] === UserInGroup.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["groupName"] = state?.groupName; resourceInputs["region"] = state?.region; resourceInputs["userPoolId"] = state?.userPoolId; resourceInputs["username"] = state?.username; } else { const args = argsOrState; if (args?.groupName === undefined && !opts.urn) { throw new Error("Missing required property 'groupName'"); } if (args?.userPoolId === undefined && !opts.urn) { throw new Error("Missing required property 'userPoolId'"); } if (args?.username === undefined && !opts.urn) { throw new Error("Missing required property 'username'"); } resourceInputs["groupName"] = args?.groupName; resourceInputs["region"] = args?.region; resourceInputs["userPoolId"] = args?.userPoolId; resourceInputs["username"] = args?.username; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(UserInGroup.__pulumiType, name, resourceInputs, opts); } } exports.UserInGroup = UserInGroup; /** @internal */ UserInGroup.__pulumiType = 'aws:cognito/userInGroup:UserInGroup'; //# sourceMappingURL=userInGroup.js.map