UNPKG

@equinix-labs/pulumi-equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

308 lines 12.1 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.Interconnection = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Use this resource to request the creation an Interconnection asset to connect with other parties using [Equinix Fabric - software-defined interconnections](https://metal.equinix.com/developers/docs/networking/fabric/). * * ## Example Usage * ### example fabric billed metal from fabric port * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const aSide = equinix.fabric.getPortsOutput({ * filter: { * name: "<name_of_port||port_prefix>", * }, * }); * const example = new equinix.metal.Vlan("example", { * projectId: "<metal_project_id>", * metro: "FR", * }); * const exampleInterconnection = new equinix.metal.Interconnection("exampleInterconnection", { * name: "tf-metal-from-port", * projectId: "<metal_project_id>", * type: "shared", * redundancy: "primary", * metro: "FR", * speed: "200Mbps", * serviceTokenType: "z_side", * contactEmail: "username@example.com", * vlans: [example.vxlan], * }); * const exampleConnection = new equinix.fabric.Connection("exampleConnection", { * name: "tf-metal-from-port", * type: equinix.fabric.ConnectionType.EVPL, * bandwidth: 200, * notifications: [{ * type: equinix.fabric.NotificationsType.All, * emails: ["username@example.com"], * }], * order: { * purchaseOrderNumber: "1-323292", * }, * project: { * projectId: "<fabric_project_id>", * }, * aSide: { * accessPoint: { * type: equinix.fabric.AccessPointType.Colo, * port: { * uuid: aSide.apply(aSide => aSide.data?.[0]?.uuid), * }, * linkProtocol: { * type: equinix.fabric.AccessPointLinkProtocolType.Dot1q, * vlanTag: 1234, * }, * }, * }, * zSide: { * serviceToken: { * uuid: exampleInterconnection.serviceTokens.apply(serviceTokens => serviceTokens[0].id), * }, * }, * }); * ``` * ### example fabric billed metal from fcr * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const example1 = new equinix.metal.Vlan("example1", { * projectId: "<metal_project_id>", * metro: "SV", * }); * const example = new equinix.metal.Interconnection("example", { * name: "tf-metal-from-fcr", * projectId: "<metal_project_id>", * metro: "SV", * redundancy: "primary", * type: "shared_port_vlan", * contactEmail: "username@example.com", * speed: "200Mbps", * vlans: [example1.vxlan], * }); * const exampleConnection = new equinix.fabric.Connection("exampleConnection", { * name: "tf-metal-from-fcr", * type: "IP_VC", * bandwidth: 200, * notifications: [{ * type: equinix.fabric.NotificationsType.All, * emails: ["username@example.com"], * }], * project: { * projectId: "<fabric_project_id>", * }, * aSide: { * accessPoint: { * type: "CLOUD_ROUTER", * router: { * uuid: exampleEquinixFabricCloudRouter.id, * }, * }, * }, * zSide: { * accessPoint: { * type: "METAL_NETWORK", * authenticationKey: example.authorizationCode, * }, * }, * }); * ``` * ### example fabric billed metal from network edge * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const example = new equinix.metal.Vrf("example", { * name: "tf-metal-from-ne", * metro: "FR", * localAsn: 65001, * ipRanges: ["10.99.1.0/24"], * projectId: test.id, * }); * const exampleInterconnection = new equinix.metal.Interconnection("exampleInterconnection", { * name: "tf-metal-from-ne", * projectId: "<metal_project_id>", * type: "shared", * redundancy: "primary", * metro: "FR", * speed: "200Mbps", * serviceTokenType: "z_side", * contactEmail: "username@example.com", * vrfs: [example.vxlan], * }); * const exampleConnection = new equinix.fabric.Connection("exampleConnection", { * name: "tf-metal-from-ne", * type: equinix.fabric.ConnectionType.EVPL, * bandwidth: 200, * notifications: [{ * type: equinix.fabric.NotificationsType.All, * emails: ["username@example.com"], * }], * order: { * purchaseOrderNumber: "1-323292", * }, * project: { * projectId: "<fabric_project_id>", * }, * aSide: { * accessPoint: { * type: equinix.fabric.AccessPointType.VD, * virtualDevice: { * type: "EDGE", * uuid: exampleEquinixNetworkDevice.id, * }, * }, * }, * zSide: { * serviceToken: { * uuid: exampleInterconnection.serviceTokens.apply(serviceTokens => serviceTokens[0].id), * }, * }, * }); * ``` * ### example metal billed metal to fabric port * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@equinix-labs/pulumi-equinix"; * * const aSide = equinix.fabric.getPortsOutput({ * filter: { * name: "<name_of_port||port_prefix>", * }, * }); * const example = new equinix.metal.Interconnection("example", { * name: "tf-metal-2-port", * projectId: "<metal_project_id>", * type: "shared", * redundancy: "redundant", * metro: "FR", * speed: "1Gbps", * serviceTokenType: "a_side", * contactEmail: "username@example.com", * }); * const exampleConnection = new equinix.fabric.Connection("exampleConnection", { * name: "tf-metal-2-port", * type: equinix.fabric.ConnectionType.EVPL, * notifications: [{ * type: equinix.fabric.NotificationsType.All, * emails: ["username@example.com"], * }], * project: { * projectId: "<fabric_project_id>", * }, * bandwidth: 100, * order: { * purchaseOrderNumber: "1-323292", * }, * aSide: { * serviceToken: { * uuid: example.serviceTokens.apply(serviceTokens => serviceTokens[0].id), * }, * }, * zSide: { * accessPoint: { * type: equinix.fabric.AccessPointType.Colo, * port: { * uuid: aSide.apply(aSide => aSide.data?.[0]?.uuid), * }, * linkProtocol: { * type: equinix.fabric.AccessPointLinkProtocolType.Dot1q, * vlanTag: 1234, * }, * }, * }, * }); * ``` */ class Interconnection extends pulumi.CustomResource { /** * Get an existing Interconnection 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 Interconnection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Interconnection. 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'] === Interconnection.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorizationCode"] = state ? state.authorizationCode : undefined; resourceInputs["contactEmail"] = state ? state.contactEmail : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["facility"] = state ? state.facility : undefined; resourceInputs["metro"] = state ? state.metro : undefined; resourceInputs["mode"] = state ? state.mode : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["organizationId"] = state ? state.organizationId : undefined; resourceInputs["ports"] = state ? state.ports : undefined; resourceInputs["projectId"] = state ? state.projectId : undefined; resourceInputs["redundancy"] = state ? state.redundancy : undefined; resourceInputs["serviceTokenType"] = state ? state.serviceTokenType : undefined; resourceInputs["serviceTokens"] = state ? state.serviceTokens : undefined; resourceInputs["speed"] = state ? state.speed : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["token"] = state ? state.token : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["vlans"] = state ? state.vlans : undefined; resourceInputs["vrfs"] = state ? state.vrfs : undefined; } else { const args = argsOrState; if ((!args || args.redundancy === undefined) && !opts.urn) { throw new Error("Missing required property 'redundancy'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } resourceInputs["contactEmail"] = args ? args.contactEmail : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["facility"] = args ? args.facility : undefined; resourceInputs["metro"] = args ? args.metro : undefined; resourceInputs["mode"] = args ? args.mode : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["organizationId"] = args ? args.organizationId : undefined; resourceInputs["projectId"] = args ? args.projectId : undefined; resourceInputs["redundancy"] = args ? args.redundancy : undefined; resourceInputs["serviceTokenType"] = args ? args.serviceTokenType : undefined; resourceInputs["speed"] = args ? args.speed : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["vlans"] = args ? args.vlans : undefined; resourceInputs["vrfs"] = args ? args.vrfs : undefined; resourceInputs["authorizationCode"] = undefined /*out*/; resourceInputs["ports"] = undefined /*out*/; resourceInputs["serviceTokens"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["token"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Interconnection.__pulumiType, name, resourceInputs, opts); } } exports.Interconnection = Interconnection; /** @internal */ Interconnection.__pulumiType = 'equinix:metal/interconnection:Interconnection'; //# sourceMappingURL=interconnection.js.map