UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

82 lines 3.33 kB
"use strict"; // *** 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.Vip = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a VIP resource within HuaweiCloud IEC. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const iecSubnetId = config.requireObject("iecSubnetId"); * const vipTest = new huaweicloud.iec.Vip("vipTest", {subnetId: iecSubnetId}); * ``` * * ## Import * * IEC VIP can be imported using the `id`, e.g. bash * * ```sh * $ pulumi import huaweicloud:Iec/vip:Vip vip_test 61fd8d31-8f92-4526-a5f5-07ec303e69e7 * ``` */ class Vip extends pulumi.CustomResource { /** * Get an existing Vip 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 Vip(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Vip. 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'] === Vip.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["allowedAddresses"] = state ? state.allowedAddresses : undefined; resourceInputs["ipAddress"] = state ? state.ipAddress : undefined; resourceInputs["macAddress"] = state ? state.macAddress : undefined; resourceInputs["portIds"] = state ? state.portIds : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; } else { const args = argsOrState; if ((!args || args.subnetId === undefined) && !opts.urn) { throw new Error("Missing required property 'subnetId'"); } resourceInputs["ipAddress"] = args ? args.ipAddress : undefined; resourceInputs["portIds"] = args ? args.portIds : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; resourceInputs["allowedAddresses"] = undefined /*out*/; resourceInputs["macAddress"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Vip.__pulumiType, name, resourceInputs, opts); } } exports.Vip = Vip; /** @internal */ Vip.__pulumiType = 'huaweicloud:Iec/vip:Vip'; //# sourceMappingURL=vip.js.map