@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
131 lines • 6 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.VpcChannel = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* !> **WARNING:** It has been deprecated.
*
* Manages a VPC channel resource within HuaweiCloud.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const instanceId = config.requireObject("instanceId");
* const channelName = config.requireObject("channelName");
* const ecsId1 = config.requireObject("ecsId1");
* const ecsId2 = config.requireObject("ecsId2");
* const test = new huaweicloud.dedicatedapig.VpcChannel("test", {
* instanceId: instanceId,
* port: 8080,
* protocol: "HTTPS",
* path: "/",
* httpCode: "201,202,203",
* members: [
* {
* id: ecsId1,
* weight: 30,
* },
* {
* id: ecsId2,
* weight: 70,
* },
* ],
* });
* ```
*
* ## Import
*
* VPC Channels can be imported using their `name` and the ID of the related dedicated instance, separated by a slash, e.g.
*
* ```sh
* $ pulumi import huaweicloud:DedicatedApig/vpcChannel:VpcChannel test <instance_id>/<name>
* ```
*/
class VpcChannel extends pulumi.CustomResource {
/**
* Get an existing VpcChannel 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 VpcChannel(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of VpcChannel. 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'] === VpcChannel.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["algorithm"] = state ? state.algorithm : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["healthyThreshold"] = state ? state.healthyThreshold : undefined;
resourceInputs["httpCode"] = state ? state.httpCode : undefined;
resourceInputs["instanceId"] = state ? state.instanceId : undefined;
resourceInputs["interval"] = state ? state.interval : undefined;
resourceInputs["memberType"] = state ? state.memberType : undefined;
resourceInputs["members"] = state ? state.members : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["path"] = state ? state.path : undefined;
resourceInputs["port"] = state ? state.port : undefined;
resourceInputs["protocol"] = state ? state.protocol : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["timeout"] = state ? state.timeout : undefined;
resourceInputs["unhealthyThreshold"] = state ? state.unhealthyThreshold : undefined;
}
else {
const args = argsOrState;
if ((!args || args.instanceId === undefined) && !opts.urn) {
throw new Error("Missing required property 'instanceId'");
}
if ((!args || args.members === undefined) && !opts.urn) {
throw new Error("Missing required property 'members'");
}
if ((!args || args.port === undefined) && !opts.urn) {
throw new Error("Missing required property 'port'");
}
resourceInputs["algorithm"] = args ? args.algorithm : undefined;
resourceInputs["healthyThreshold"] = args ? args.healthyThreshold : undefined;
resourceInputs["httpCode"] = args ? args.httpCode : undefined;
resourceInputs["instanceId"] = args ? args.instanceId : undefined;
resourceInputs["interval"] = args ? args.interval : undefined;
resourceInputs["memberType"] = args ? args.memberType : undefined;
resourceInputs["members"] = args ? args.members : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["path"] = args ? args.path : undefined;
resourceInputs["port"] = args ? args.port : undefined;
resourceInputs["protocol"] = args ? args.protocol : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["timeout"] = args ? args.timeout : undefined;
resourceInputs["unhealthyThreshold"] = args ? args.unhealthyThreshold : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["status"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpcChannel.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpcChannel = VpcChannel;
/** @internal */
VpcChannel.__pulumiType = 'huaweicloud:DedicatedApig/vpcChannel:VpcChannel';
//# sourceMappingURL=vpcChannel.js.map