@pulumi/openstack
Version:
A Pulumi package for creating and managing OpenStack cloud resources.
122 lines • 4.79 kB
JavaScript
;
// *** 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.Trunk = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a networking V2 trunk 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: "network_1",
* adminStateUp: true,
* });
* const subnet1 = new openstack.networking.Subnet("subnet_1", {
* name: "subnet_1",
* networkId: network1.id,
* cidr: "192.168.1.0/24",
* ipVersion: 4,
* enableDhcp: true,
* noGateway: true,
* });
* const parentPort1 = new openstack.networking.Port("parent_port_1", {
* name: "parent_port_1",
* networkId: network1.id,
* adminStateUp: true,
* }, {
* dependsOn: [subnet1],
* });
* const subport1 = new openstack.networking.Port("subport_1", {
* name: "subport_1",
* networkId: network1.id,
* adminStateUp: true,
* }, {
* dependsOn: [subnet1],
* });
* const trunk1 = new openstack.networking.Trunk("trunk_1", {
* name: "trunk_1",
* adminStateUp: true,
* portId: parentPort1.id,
* subPorts: [{
* portId: subport1.id,
* segmentationId: 1,
* segmentationType: "vlan",
* }],
* });
* const instance1 = new openstack.compute.Instance("instance_1", {
* name: "instance_1",
* securityGroups: ["default"],
* networks: [{
* port: trunk1.portId,
* }],
* });
* ```
*/
class Trunk extends pulumi.CustomResource {
/**
* Get an existing Trunk 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 Trunk(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Trunk. 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'] === Trunk.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["adminStateUp"] = state ? state.adminStateUp : undefined;
resourceInputs["allTags"] = state ? state.allTags : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["portId"] = state ? state.portId : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["subPorts"] = state ? state.subPorts : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tenantId"] = state ? state.tenantId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.portId === undefined) && !opts.urn) {
throw new Error("Missing required property 'portId'");
}
resourceInputs["adminStateUp"] = args ? args.adminStateUp : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["portId"] = args ? args.portId : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["subPorts"] = args ? args.subPorts : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["tenantId"] = args ? args.tenantId : undefined;
resourceInputs["allTags"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Trunk.__pulumiType, name, resourceInputs, opts);
}
}
exports.Trunk = Trunk;
/** @internal */
Trunk.__pulumiType = 'openstack:networking/trunk:Trunk';
//# sourceMappingURL=trunk.js.map