@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
109 lines • 4.98 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.Agency = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an agency resource within HuaweiCloud.
*
* > **NOTE:** You *must* have admin privileges to use this resource.
*
* ## Example Usage
* ### Delegate another HUAWEI CLOUD account to perform operations on your resources
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as huaweicloud from "@pulumi/huaweicloud";
*
* const agency = new huaweicloud.Iam.Agency("agency", {
* allResourcesRoles: ["Server Administrator"],
* delegatedDomainName: "***",
* description: "test agency",
* domainRoles: ["Anti-DDoS Administrator"],
* projectRoles: [{
* project: "cn-north-1",
* roles: ["Tenant Administrator"],
* }],
* });
* ```
*
* ## Import
*
* Agencies can be imported using the `id`, e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Iam/agency:Agency agency 0b97661f9900f23f4fc2c00971ea4dc0
* ```
*
* Note that the imported state may not be identical to your resource definition, due to `all_resources_roles` field is missing from the API response. It is generally recommended running `terraform plan` after importing an agency. You can then decide if changes should be applied to the agency, or the resource definition should be updated to align with the agency. Also you can ignore changes as below. hcl resource "huaweicloud_identity_agency" "agency" {
*
* ...
*
* lifecycle {
*
* ignore_changes = [all_resources_roles]
*
* } }
*/
class Agency extends pulumi.CustomResource {
/**
* Get an existing Agency 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 Agency(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Agency. 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'] === Agency.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["allResourcesRoles"] = state ? state.allResourcesRoles : undefined;
resourceInputs["createTime"] = state ? state.createTime : undefined;
resourceInputs["delegatedDomainName"] = state ? state.delegatedDomainName : undefined;
resourceInputs["delegatedServiceName"] = state ? state.delegatedServiceName : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["domainRoles"] = state ? state.domainRoles : undefined;
resourceInputs["duration"] = state ? state.duration : undefined;
resourceInputs["expireTime"] = state ? state.expireTime : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectRoles"] = state ? state.projectRoles : undefined;
}
else {
const args = argsOrState;
resourceInputs["allResourcesRoles"] = args ? args.allResourcesRoles : undefined;
resourceInputs["delegatedDomainName"] = args ? args.delegatedDomainName : undefined;
resourceInputs["delegatedServiceName"] = args ? args.delegatedServiceName : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["domainRoles"] = args ? args.domainRoles : undefined;
resourceInputs["duration"] = args ? args.duration : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectRoles"] = args ? args.projectRoles : undefined;
resourceInputs["createTime"] = undefined /*out*/;
resourceInputs["expireTime"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Agency.__pulumiType, name, resourceInputs, opts);
}
}
exports.Agency = Agency;
/** @internal */
Agency.__pulumiType = 'huaweicloud:Iam/agency:Agency';
//# sourceMappingURL=agency.js.map