@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
115 lines • 4.38 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.UserGroup = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a Cognito User Group resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const main = new aws.cognito.UserPool("main", {name: "identity pool"});
* const groupRole = aws.iam.getPolicyDocument({
* statements: [{
* effect: "Allow",
* principals: [{
* type: "Federated",
* identifiers: ["cognito-identity.amazonaws.com"],
* }],
* actions: ["sts:AssumeRoleWithWebIdentity"],
* conditions: [
* {
* test: "StringEquals",
* variable: "cognito-identity.amazonaws.com:aud",
* values: ["us-east-1:12345678-dead-beef-cafe-123456790ab"],
* },
* {
* test: "ForAnyValue:StringLike",
* variable: "cognito-identity.amazonaws.com:amr",
* values: ["authenticated"],
* },
* ],
* }],
* });
* const groupRoleRole = new aws.iam.Role("group_role", {
* name: "user-group-role",
* assumeRolePolicy: groupRole.then(groupRole => groupRole.json),
* });
* const mainUserGroup = new aws.cognito.UserGroup("main", {
* name: "user-group",
* userPoolId: main.id,
* description: "Managed by Pulumi",
* precedence: 42,
* roleArn: groupRoleRole.arn,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Cognito User Groups using the `user_pool_id`/`name` attributes concatenated. For example:
*
* ```sh
* $ pulumi import aws:cognito/userGroup:UserGroup group us-east-1_vG78M4goG/user-group
* ```
*/
class UserGroup extends pulumi.CustomResource {
/**
* Get an existing UserGroup 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 UserGroup(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of UserGroup. 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'] === UserGroup.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state?.description;
resourceInputs["name"] = state?.name;
resourceInputs["precedence"] = state?.precedence;
resourceInputs["region"] = state?.region;
resourceInputs["roleArn"] = state?.roleArn;
resourceInputs["userPoolId"] = state?.userPoolId;
}
else {
const args = argsOrState;
if (args?.userPoolId === undefined && !opts.urn) {
throw new Error("Missing required property 'userPoolId'");
}
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["precedence"] = args?.precedence;
resourceInputs["region"] = args?.region;
resourceInputs["roleArn"] = args?.roleArn;
resourceInputs["userPoolId"] = args?.userPoolId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UserGroup.__pulumiType, name, resourceInputs, opts);
}
}
exports.UserGroup = UserGroup;
/** @internal */
UserGroup.__pulumiType = 'aws:cognito/userGroup:UserGroup';
//# sourceMappingURL=userGroup.js.map