@equinix-labs/pulumi-equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
133 lines • 7.08 kB
JavaScript
;
// *** 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.VirtualCircuit = 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://deploy.equinix.com/developers/docs/metal/interconnections/introduction/#associating-a-vlan-with-a-dedicated-port).
*
* See the [Virtual Routing and Forwarding documentation](https://deploy.equinix.com/developers/docs/metal/layer2-networking/vrf/) for product details and API reference material.
*
* ## Example Usage
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@equinix-labs/pulumi-equinix";
*
* const projectId = "52000fb2-ee46-4673-93a8-de2c2bdba33c";
* const connId = "73f12f29-3e19-43a0-8e90-ae81580db1e0";
* const test = equinix.metal.getInterconnectionOutput({
* connectionId: connId,
* });
* const testVlan = new equinix.metal.Vlan("testVlan", {
* projectId: projectId,
* metro: test.apply(test => test.metro),
* });
* const testVirtualCircuit = new equinix.metal.VirtualCircuit("testVirtualCircuit", {
* connectionId: connId,
* projectId: projectId,
* portId: test.apply(test => test.ports?.[0]?.id),
* vlanId: testVlan.id,
* nniVlan: 1056,
* });
* ```
*
* ## Import
*
* ```sh
* $ pulumi import equinix:metal/virtualCircuit:VirtualCircuit equinix_metal_virtual_circuit {existing_id}
* ```
*/
class VirtualCircuit extends pulumi.CustomResource {
/**
* Get an existing VirtualCircuit 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 VirtualCircuit(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of VirtualCircuit. 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'] === VirtualCircuit.__pulumiType;
}
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["customerIpv6"] = state ? state.customerIpv6 : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["md5"] = state ? state.md5 : undefined;
resourceInputs["metalIp"] = state ? state.metalIp : undefined;
resourceInputs["metalIpv6"] = state ? state.metalIpv6 : 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["subnetIpv6"] = state ? state.subnetIpv6 : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["virtualCircuitId"] = state ? state.virtualCircuitId : 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.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["customerIpv6"] = args ? args.customerIpv6 : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["md5"] = (args === null || args === void 0 ? void 0 : args.md5) ? pulumi.secret(args.md5) : undefined;
resourceInputs["metalIp"] = args ? args.metalIp : undefined;
resourceInputs["metalIpv6"] = args ? args.metalIpv6 : 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["subnetIpv6"] = args ? args.subnetIpv6 : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["virtualCircuitId"] = args ? args.virtualCircuitId : 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);
const secretOpts = { additionalSecretOutputs: ["md5"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(VirtualCircuit.__pulumiType, name, resourceInputs, opts);
}
}
exports.VirtualCircuit = VirtualCircuit;
/** @internal */
VirtualCircuit.__pulumiType = 'equinix:metal/virtualCircuit:VirtualCircuit';
//# sourceMappingURL=virtualCircuit.js.map