UNPKG

@volcengine/pulumi

Version:

A Pulumi package for creating and managing volcengine cloud resources.

92 lines 3.61 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.UserAttachment = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to manage cloud identity user attachment * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as volcengine from "@volcengine/pulumi"; * * const fooGroup = new volcengine.cloud_identity.Group("fooGroup", { * groupName: "acc-test-group", * displayName: "tf-test-group", * joinType: "Manual", * description: "tf", * }); * const fooUser = new volcengine.cloud_identity.User("fooUser", { * userName: "acc-test-user", * displayName: "tf-test-user", * description: "tf", * email: "88@qq.com", * phone: "181", * }); * const fooUserAttachment = new volcengine.cloud_identity.UserAttachment("fooUserAttachment", { * userId: fooUser.id, * groupId: fooGroup.id, * }); * ``` * * ## Import * * CloudIdentityUserAttachment can be imported using the group_id:user_id, e.g. * * ```sh * $ pulumi import volcengine:cloud_identity/userAttachment:UserAttachment default resource_id * ``` */ class UserAttachment extends pulumi.CustomResource { /** * Get an existing UserAttachment 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 UserAttachment(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of UserAttachment. 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'] === UserAttachment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["groupId"] = state ? state.groupId : undefined; resourceInputs["userId"] = state ? state.userId : undefined; } else { const args = argsOrState; if ((!args || args.groupId === undefined) && !opts.urn) { throw new Error("Missing required property 'groupId'"); } if ((!args || args.userId === undefined) && !opts.urn) { throw new Error("Missing required property 'userId'"); } resourceInputs["groupId"] = args ? args.groupId : undefined; resourceInputs["userId"] = args ? args.userId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(UserAttachment.__pulumiType, name, resourceInputs, opts); } } exports.UserAttachment = UserAttachment; /** @internal */ UserAttachment.__pulumiType = 'volcengine:cloud_identity/userAttachment:UserAttachment'; //# sourceMappingURL=userAttachment.js.map