UNPKG

@cuemby/equinix

Version:

A Pulumi package for creating and managing equinix cloud resources.

125 lines 6.43 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.MetalConnection = 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/). * * > Equinix Metal connection with serviceTokenType `aSide` is not generally available and may not be enabled yet for your organization. * * ## Example Usage * ### Shared Connection with zSide token - Non-redundant Connection from your own Equinix Fabric Port to Equinix Metal * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as equinix from "@cuemby/equinix"; * import * as equinix from "@pulumi/equinix"; * * const exampleMetalConnection = new equinix.MetalConnection("exampleMetalConnection", { * projectId: local.project_id, * type: "shared", * redundancy: "primary", * metro: "FR", * speed: "200Mbps", * serviceTokenType: "z_side", * }); * const exampleGetECXPort = equinix.GetECXPort({ * name: "CX-FR5-NL-Dot1q-BO-1G-PRI", * }); * const exampleECXL2Connection = new equinix.ECXL2Connection("exampleECXL2Connection", { * zsideServiceToken: exampleMetalConnection.serviceTokens.apply(serviceTokens => serviceTokens[0].id), * speed: 200, * speedUnit: "MB", * notifications: ["example@equinix.com"], * sellerMetroCode: "FR", * portUuid: exampleGetECXPort.then(exampleGetECXPort => exampleGetECXPort.id), * vlanStag: 1020, * }); * ``` */ class MetalConnection extends pulumi.CustomResource { constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; 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; } else { const args = argsOrState; if ((!args || args.redundancy === undefined) && !opts.urn) { throw new Error("Missing required property 'redundancy'"); } if ((!args || args.speed === undefined) && !opts.urn) { throw new Error("Missing required property 'speed'"); } if ((!args || args.type === undefined) && !opts.urn) { throw new Error("Missing required property 'type'"); } 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["ports"] = undefined /*out*/; resourceInputs["serviceTokens"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["token"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(MetalConnection.__pulumiType, name, resourceInputs, opts); } /** * Get an existing MetalConnection 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 MetalConnection(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of MetalConnection. 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'] === MetalConnection.__pulumiType; } } exports.MetalConnection = MetalConnection; /** @internal */ MetalConnection.__pulumiType = 'equinix:index/metalConnection:MetalConnection'; //# sourceMappingURL=metalConnection.js.map