@cuemby/equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
106 lines • 4.48 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.NetworkDeviceLink = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Resource `equinix.NetworkDeviceLink` allows creation and management of Equinix
* Network Edge virtual network device links.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@cuemby/equinix";
*
* // Example of device link with HA device pair
* // where each device is in different metro
* const test = new equinix.NetworkDeviceLink("test", {
* subnet: "192.168.40.64/27",
* devices: [
* {
* id: equinix_network_device.test.uuid,
* asn: equinix_network_device.test.asn > 0 ? equinix_network_device.test.asn : 22111,
* interfaceId: 6,
* },
* {
* id: equinix_network_device.test.secondary_device[0].uuid,
* asn: equinix_network_device.test.secondary_device[0].asn > 0 ? equinix_network_device.test.secondary_device[0].asn : 22333,
* interfaceId: 7,
* },
* ],
* links: [{
* accountNumber: equinix_network_device.test.account_number,
* srcMetroCode: equinix_network_device.test.metro_code,
* dstMetroCode: equinix_network_device.test.secondary_device[0].metro_code,
* throughput: "50",
* throughputUnit: "Mbps",
* }],
* });
* ```
*
* ## Import
*
* This resource can be imported using an existing ID
*
* ```sh
* $ pulumi import equinix:index/networkDeviceLink:NetworkDeviceLink example {existing_id}
* ```
*/
class NetworkDeviceLink extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["devices"] = state ? state.devices : undefined;
resourceInputs["links"] = state ? state.links : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["subnet"] = state ? state.subnet : undefined;
resourceInputs["uuid"] = state ? state.uuid : undefined;
}
else {
const args = argsOrState;
if ((!args || args.devices === undefined) && !opts.urn) {
throw new Error("Missing required property 'devices'");
}
resourceInputs["devices"] = args ? args.devices : undefined;
resourceInputs["links"] = args ? args.links : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["subnet"] = args ? args.subnet : undefined;
resourceInputs["status"] = undefined /*out*/;
resourceInputs["uuid"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(NetworkDeviceLink.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing NetworkDeviceLink 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 NetworkDeviceLink(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of NetworkDeviceLink. 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'] === NetworkDeviceLink.__pulumiType;
}
}
exports.NetworkDeviceLink = NetworkDeviceLink;
/** @internal */
NetworkDeviceLink.__pulumiType = 'equinix:index/networkDeviceLink:NetworkDeviceLink';
//# sourceMappingURL=networkDeviceLink.js.map