@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
97 lines • 4.26 kB
JavaScript
;
// *** 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.AdminAssignment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Using this resource to assign an administrator role to a user within HuaweiCloud.
*
* ## Example Usage
* ### Assign an administrator role to a user
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const appId = config.requireObject("appId");
* const appKey = config.requireObject("appKey");
* const userAccount = config.requireObject("userAccount");
* const test = new huaweicloud.meeting.AdminAssignment("test", {
* appId: appId,
* appKey: appKey,
* account: userAccount,
* });
* ```
*
* ## Import
*
* The assignment relationships can be imported using their `id` and authorization parameters, separated by slashes, e.g. Import an administrator assignment and authenticated by account. bash
*
* ```sh
* $ pulumi import huaweicloud:Meeting/adminAssignment:AdminAssignment test <id>/<account_name>/<account_password>
* ```
*
* Import an administrator assignment and authenticated by `APP ID`/`APP Key`. bash
*
* ```sh
* $ pulumi import huaweicloud:Meeting/adminAssignment:AdminAssignment test <id>/<app_id>/<app_key>/<corp_id>/<user_id>
* ```
*
* For this resource, the `corp_id` and `user_id` are never used, you can omit them but the slashes cannot be missing.
*/
class AdminAssignment extends pulumi.CustomResource {
/**
* Get an existing AdminAssignment 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 AdminAssignment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AdminAssignment. 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'] === AdminAssignment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["account"] = state ? state.account : undefined;
resourceInputs["accountName"] = state ? state.accountName : undefined;
resourceInputs["accountPassword"] = state ? state.accountPassword : undefined;
resourceInputs["appId"] = state ? state.appId : undefined;
resourceInputs["appKey"] = state ? state.appKey : undefined;
}
else {
const args = argsOrState;
if ((!args || args.account === undefined) && !opts.urn) {
throw new Error("Missing required property 'account'");
}
resourceInputs["account"] = args ? args.account : undefined;
resourceInputs["accountName"] = args ? args.accountName : undefined;
resourceInputs["accountPassword"] = args ? args.accountPassword : undefined;
resourceInputs["appId"] = args ? args.appId : undefined;
resourceInputs["appKey"] = args ? args.appKey : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AdminAssignment.__pulumiType, name, resourceInputs, opts);
}
}
exports.AdminAssignment = AdminAssignment;
/** @internal */
AdminAssignment.__pulumiType = 'huaweicloud:Meeting/adminAssignment:AdminAssignment';
//# sourceMappingURL=adminAssignment.js.map