UNPKG

@cuemby/equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

134 lines 6.81 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.MetalVirtualCircuit = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Use this resource to associate VLAN with a Dedicated Port from * [Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/#associating-a-vlan-with-a-dedicated-port). * * > VRF features are not generally available. The interfaces related to VRF resources may change ahead of general availability. * * ## Example Usage * * Pick an existing Project and Connection, create a VLAN and use `equinix.MetalVirtualCircuit` * to associate it with a Primary Port of the Connection. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@cuemby/equinix"; * import * as equinix from "@pulumi/equinix"; * * const projectId = "52000fb2-ee46-4673-93a8-de2c2bdba33c"; * const connId = "73f12f29-3e19-43a0-8e90-ae81580db1e0"; * const testGetMetalConnection = equinix.GetMetalConnection({ * connectionId: connId, * }); * const testMetalVlan = new equinix.MetalVlan("testMetalVlan", { * projectId: projectId, * metro: testGetMetalConnection.then(testGetMetalConnection => testGetMetalConnection.metro), * }); * const testMetalVirtualCircuit = new equinix.MetalVirtualCircuit("testMetalVirtualCircuit", { * connectionId: connId, * projectId: projectId, * portId: testGetMetalConnection.then(testGetMetalConnection => testGetMetalConnection.ports?[0]?.id), * vlanId: testMetalVlan.id, * nniVlan: 1056, * }); * ``` * * ## Import * * This resource can be imported using an existing Virtual Circuit ID * * ```sh * $ pulumi import equinix:index/metalVirtualCircuit:MetalVirtualCircuit equinix_metal_virtual_circuit {existing_id} * ``` */ class MetalVirtualCircuit extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["connectionId"] = state ? state.connectionId : undefined; resourceInputs["customerIp"] = state ? state.customerIp : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["md5"] = state ? state.md5 : undefined; resourceInputs["metalIp"] = state ? state.metalIp : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["nniVlan"] = state ? state.nniVlan : undefined; resourceInputs["nniVnid"] = state ? state.nniVnid : undefined; resourceInputs["peerAsn"] = state ? state.peerAsn : undefined; resourceInputs["portId"] = state ? state.portId : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["speed"] = state ? state.speed : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["subnet"] = state ? state.subnet : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["vlanId"] = state ? state.vlanId : undefined; resourceInputs["vnid"] = state ? state.vnid : undefined; resourceInputs["vrfId"] = state ? state.vrfId : undefined; } else { const args = argsOrState; if ((!args || args.connectionId === undefined) && !opts.urn) { throw new Error("Missing required property 'connectionId'"); } if ((!args || args.portId === undefined) && !opts.urn) { throw new Error("Missing required property 'portId'"); } if ((!args || args.projectId === undefined) && !opts.urn) { throw new Error("Missing required property 'projectId'"); } resourceInputs["connectionId"] = args ? args.connectionId : undefined; resourceInputs["customerIp"] = args ? args.customerIp : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["md5"] = args ? args.md5 : undefined; resourceInputs["metalIp"] = args ? args.metalIp : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["nniVlan"] = args ? args.nniVlan : undefined; resourceInputs["peerAsn"] = args ? args.peerAsn : undefined; resourceInputs["portId"] = args ? args.portId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["speed"] = args ? args.speed : undefined; resourceInputs["subnet"] = args ? args.subnet : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["vlanId"] = args ? args.vlanId : undefined; resourceInputs["vrfId"] = args ? args.vrfId : undefined; resourceInputs["nniVnid"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["vnid"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MetalVirtualCircuit.__pulumiType, name, resourceInputs, opts); } /** * Get an existing MetalVirtualCircuit 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 MetalVirtualCircuit(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MetalVirtualCircuit. 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'] === MetalVirtualCircuit.__pulumiType; } } exports.MetalVirtualCircuit = MetalVirtualCircuit; /** @internal */ MetalVirtualCircuit.__pulumiType = 'equinix:index/metalVirtualCircuit:MetalVirtualCircuit'; //# sourceMappingURL=metalVirtualCircuit.js.map