UNPKG

@pulumi/openstack

Version:

A Pulumi package for creating and managing OpenStack cloud resources.

98 lines 3.97 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.RouterInterface = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a V2 router interface resource within OpenStack. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as openstack from "@pulumi/openstack"; * * const network1 = new openstack.networking.Network("network_1", { * name: "tf_test_network", * adminStateUp: true, * }); * const subnet1 = new openstack.networking.Subnet("subnet_1", { * networkId: network1.id, * cidr: "192.168.199.0/24", * ipVersion: 4, * }); * const router1 = new openstack.networking.Router("router_1", { * name: "my_router", * externalNetworkId: "f67f0d72-0ddf-11e4-9d95-e1f29f417e2f", * }); * const routerInterface1 = new openstack.networking.RouterInterface("router_interface_1", { * routerId: router1.id, * subnetId: subnet1.id, * }); * ``` * * ## Import * * Router Interfaces can be imported using the port `id`, e.g. * * $ openstack port list --router <router name or id> * * ```sh * $ pulumi import openstack:networking/routerInterface:RouterInterface int_1 port_id * ``` */ class RouterInterface extends pulumi.CustomResource { /** * Get an existing RouterInterface 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 RouterInterface(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of RouterInterface. 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'] === RouterInterface.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined; resourceInputs["portId"] = state ? state.portId : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["routerId"] = state ? state.routerId : undefined; resourceInputs["subnetId"] = state ? state.subnetId : undefined; } else { const args = argsOrState; if ((!args || args.routerId === undefined) && !opts.urn) { throw new Error("Missing required property 'routerId'"); } resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined; resourceInputs["portId"] = args ? args.portId : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["routerId"] = args ? args.routerId : undefined; resourceInputs["subnetId"] = args ? args.subnetId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RouterInterface.__pulumiType, name, resourceInputs, opts); } } exports.RouterInterface = RouterInterface; /** @internal */ RouterInterface.__pulumiType = 'openstack:networking/routerInterface:RouterInterface'; //# sourceMappingURL=routerInterface.js.map