@huaweicloudos/pulumi
Version:
A Pulumi package for creating and managing Huaweicloud cloud resources.
93 lines • 3.99 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.VipAssociate = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Using this resource, one or more NICs (to which the ECS instance belongs) can be bound to the VIP.
*
* > A VIP can only have one resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pulumi from "@huaweicloudos/pulumi";
*
* const config = new pulumi.Config();
* const vipId = config.requireObject("vipId");
* const nicPortIds = config.requireObject("nicPortIds");
* const vipAssociated = new huaweicloud.vpc.VipAssociate("vipAssociated", {
* vipId: vipId,
* portIds: nicPortIds,
* });
* ```
*
* ## Import
*
* Vip associate can be imported using the `vip_id` and port IDs separated by slashes (no limit on the number of port IDs), e.g. bash
*
* ```sh
* $ pulumi import huaweicloud:Vpc/vipAssociate:VipAssociate vip_associated vip_id/port1_id/port2_id
* ```
*/
class VipAssociate extends pulumi.CustomResource {
/**
* Get an existing VipAssociate 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 VipAssociate(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of VipAssociate. 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'] === VipAssociate.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["ipAddresses"] = state ? state.ipAddresses : undefined;
resourceInputs["portIds"] = state ? state.portIds : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["vipId"] = state ? state.vipId : undefined;
resourceInputs["vipIpAddress"] = state ? state.vipIpAddress : undefined;
resourceInputs["vipSubnetId"] = state ? state.vipSubnetId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.portIds === undefined) && !opts.urn) {
throw new Error("Missing required property 'portIds'");
}
if ((!args || args.vipId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vipId'");
}
resourceInputs["portIds"] = args ? args.portIds : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["vipId"] = args ? args.vipId : undefined;
resourceInputs["ipAddresses"] = undefined /*out*/;
resourceInputs["vipIpAddress"] = undefined /*out*/;
resourceInputs["vipSubnetId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VipAssociate.__pulumiType, name, resourceInputs, opts);
}
}
exports.VipAssociate = VipAssociate;
/** @internal */
VipAssociate.__pulumiType = 'huaweicloud:Vpc/vipAssociate:VipAssociate';
//# sourceMappingURL=vipAssociate.js.map