@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
105 lines • 4.49 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.Environment = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an environment resource within HuaweiCloud ServiceStage.
*
* ## Example Usage
* ### Create an environment based on some cce clusters
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const envName = config.requireObject("envName");
* const vpcId = config.requireObject("vpcId");
* const cceClusterId = config.requireObject("cceClusterId");
* const cciNamespaceName = config.requireObject("cciNamespaceName");
* const test = new huaweicloud.servicestage.Environment("test", {
* vpcId: vpcId,
* basicResources: [
* {
* type: "cce",
* id: cceClusterId,
* },
* {
* type: "cci",
* id: cciNamespaceName,
* },
* ],
* });
* ```
*
* ## Import
*
* Environments can be imported using their `id`, e.g.bash
*
* ```sh
* $ pulumi import huaweicloud:ServiceStage/environment:Environment test 17383329-b686-47e4-8f70-0d8dcddb65e9
* ```
*/
class Environment extends pulumi.CustomResource {
/**
* Get an existing Environment 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 Environment(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Environment. 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'] === Environment.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["basicResources"] = state ? state.basicResources : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["enterpriseProjectId"] = state ? state.enterpriseProjectId : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["optionalResources"] = state ? state.optionalResources : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["vpcId"] = state ? state.vpcId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.basicResources === undefined) && !opts.urn) {
throw new Error("Missing required property 'basicResources'");
}
if ((!args || args.vpcId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vpcId'");
}
resourceInputs["basicResources"] = args ? args.basicResources : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["enterpriseProjectId"] = args ? args.enterpriseProjectId : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["optionalResources"] = args ? args.optionalResources : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["vpcId"] = args ? args.vpcId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Environment.__pulumiType, name, resourceInputs, opts);
}
}
exports.Environment = Environment;
/** @internal */
Environment.__pulumiType = 'huaweicloud:ServiceStage/environment:Environment';
//# sourceMappingURL=environment.js.map