@equinix-labs/pulumi-equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
142 lines • 5.66 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.Vrf = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this resource to manage a VRF.
*
* 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
* ### example 1
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@equinix-labs/pulumi-equinix";
*
* const example = new equinix.metal.Project("example", {name: "example"});
* const exampleVrf = new equinix.metal.Vrf("exampleVrf", {
* description: "VRF with ASN 65000 and a pool of address space that includes 192.168.100.0/25",
* name: "example-vrf",
* metro: "da",
* localAsn: 65000,
* ipRanges: [
* "192.168.100.0/25",
* "192.168.200.0/25",
* ],
* projectId: example.id,
* });
* ```
* ### example 2
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@equinix-labs/pulumi-equinix";
*
* const example = new equinix.metal.ReservedIpBlock("example", {
* description: "Reserved IP block (192.168.100.0/29) taken from on of the ranges in the VRF's pool of address space.",
* projectId: exampleEquinixMetalProject.id,
* metro: exampleEquinixMetalVrf.metro,
* type: "vrf",
* vrfId: exampleEquinixMetalVrf.id,
* cidr: 29,
* network: "192.168.100.0",
* });
* const exampleVlan = new equinix.metal.Vlan("exampleVlan", {
* description: "A VLAN for Layer2 and Hybrid Metal devices",
* metro: exampleEquinixMetalVrf.metro,
* projectId: exampleEquinixMetalProject.id,
* });
* const exampleGateway = new equinix.metal.Gateway("exampleGateway", {
* projectId: exampleEquinixMetalProject.id,
* vlanId: exampleVlan.id,
* ipReservationId: example.id,
* });
* ```
* ### example 3
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@equinix-labs/pulumi-equinix";
*
* const exampleVirtualCircuit = new equinix.metal.VirtualCircuit("exampleVirtualCircuit", {
* name: "example-vc",
* description: "Virtual Circuit",
* connectionId: example.id,
* projectId: exampleEquinixMetalProject.id,
* portId: example.ports[0].id,
* nniVlan: 1024,
* vrfId: exampleEquinixMetalVrf.id,
* peerAsn: 65530,
* subnet: "192.168.100.16/31",
* metalIp: "192.168.100.16",
* customerIp: "192.168.100.17",
* });
* ```
*
* ## Import
*
* This resource can be imported using an existing VRF ID:
*
* ```sh
* $ pulumi import equinix:metal/vrf:Vrf equinix_metal_vrf {existing_id}
* ```
*/
class Vrf extends pulumi.CustomResource {
/**
* Get an existing Vrf 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 Vrf(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Vrf. 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'] === Vrf.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["ipRanges"] = state ? state.ipRanges : undefined;
resourceInputs["localAsn"] = state ? state.localAsn : undefined;
resourceInputs["metro"] = state ? state.metro : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.metro === undefined) && !opts.urn) {
throw new Error("Missing required property 'metro'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["ipRanges"] = args ? args.ipRanges : undefined;
resourceInputs["localAsn"] = args ? args.localAsn : undefined;
resourceInputs["metro"] = args ? args.metro : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Vrf.__pulumiType, name, resourceInputs, opts);
}
}
exports.Vrf = Vrf;
/** @internal */
Vrf.__pulumiType = 'equinix:metal/vrf:Vrf';
//# sourceMappingURL=vrf.js.map