@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
97 lines • 4.36 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.GrantInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage cen grant instance
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.cen.GrantInstance("foo", {
* cenId: "cen-2d6zdn0c1z5s058ozfcyf4lee",
* cenOwnerId: "210000****",
* instanceId: "vpc-2bysvq1xx543k2dx0eeulpeiv",
* instanceRegionId: "cn-beijing",
* instanceType: "VPC",
* });
* ```
*
* ## Import
*
* Cen grant instance can be imported using the CenId:CenOwnerId:InstanceId:InstanceType:RegionId, e.g.
*
* ```sh
* $ pulumi import volcengine:cen/grantInstance:GrantInstance default cen-7qthudw0ll6jmc***:210000****:vpc-2fexiqjlgjif45oxruvso****:VPC:cn-beijing
* ```
*/
class GrantInstance extends pulumi.CustomResource {
/**
* Get an existing GrantInstance 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 GrantInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of GrantInstance. 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'] === GrantInstance.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cenId"] = state ? state.cenId : undefined;
resourceInputs["cenOwnerId"] = state ? state.cenOwnerId : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["instanceRegionId"] = state ? state.instanceRegionId : undefined;
resourceInputs["instanceType"] = state ? state.instanceType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.cenId === undefined) && !opts.urn) {
throw new Error("Missing required property 'cenId'");
}
if ((!args || args.cenOwnerId === undefined) && !opts.urn) {
throw new Error("Missing required property 'cenOwnerId'");
}
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.instanceRegionId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceRegionId'");
}
if ((!args || args.instanceType === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceType'");
}
resourceInputs["cenId"] = args ? args.cenId : undefined;
resourceInputs["cenOwnerId"] = args ? args.cenOwnerId : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["instanceRegionId"] = args ? args.instanceRegionId : undefined;
resourceInputs["instanceType"] = args ? args.instanceType : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(GrantInstance.__pulumiType, name, resourceInputs, opts);
}
}
exports.GrantInstance = GrantInstance;
/** @internal */
GrantInstance.__pulumiType = 'volcengine:cen/grantInstance:GrantInstance';
//# sourceMappingURL=grantInstance.js.map