UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

101 lines 4.85 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.PortForwardingV2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V2 portforwarding resource within OpenStack. * * ## Example Usage * * ### Simple portforwarding * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const pf1 = new openstack.networking.PortForwardingV2("pf_1", { * floatingipId: "7a52eb59-7d47-415d-a884-046666a6fbae", * externalPort: 7233, * internalPort: 25, * internalPortId: "b930d7f6-ceb7-40a0-8b81-a425dd994ccf", * protocol: "tcp", * }); * ``` */ class PortForwardingV2 extends pulumi.CustomResource { /** * Get an existing PortForwardingV2 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 PortForwardingV2(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of PortForwardingV2. 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'] === PortForwardingV2.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["externalPort"] = state ? state.externalPort : undefined; resourceInputs["floatingipId"] = state ? state.floatingipId : undefined; resourceInputs["internalIpAddress"] = state ? state.internalIpAddress : undefined; resourceInputs["internalPort"] = state ? state.internalPort : undefined; resourceInputs["internalPortId"] = state ? state.internalPortId : undefined; resourceInputs["protocol"] = state ? state.protocol : undefined; resourceInputs["region"] = state ? state.region : undefined; } else { const args = argsOrState; if ((!args || args.externalPort === undefined) && !opts.urn) { throw new Error("Missing required property 'externalPort'"); } if ((!args || args.floatingipId === undefined) && !opts.urn) { throw new Error("Missing required property 'floatingipId'"); } if ((!args || args.internalIpAddress === undefined) && !opts.urn) { throw new Error("Missing required property 'internalIpAddress'"); } if ((!args || args.internalPort === undefined) && !opts.urn) { throw new Error("Missing required property 'internalPort'"); } if ((!args || args.internalPortId === undefined) && !opts.urn) { throw new Error("Missing required property 'internalPortId'"); } if ((!args || args.protocol === undefined) && !opts.urn) { throw new Error("Missing required property 'protocol'"); } resourceInputs["description"] = args ? args.description : undefined; resourceInputs["externalPort"] = args ? args.externalPort : undefined; resourceInputs["floatingipId"] = args ? args.floatingipId : undefined; resourceInputs["internalIpAddress"] = args ? args.internalIpAddress : undefined; resourceInputs["internalPort"] = args ? args.internalPort : undefined; resourceInputs["internalPortId"] = args ? args.internalPortId : undefined; resourceInputs["protocol"] = args ? args.protocol : undefined; resourceInputs["region"] = args ? args.region : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(PortForwardingV2.__pulumiType, name, resourceInputs, opts); } } exports.PortForwardingV2 = PortForwardingV2; /** @internal */ PortForwardingV2.__pulumiType = 'openstack:networking/portForwardingV2:PortForwardingV2'; //# sourceMappingURL=portForwardingV2.js.map