@equinix-labs/pulumi-equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
111 lines • 4.65 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.Gateway = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this resource to create Metal Gateway resources in Equinix Metal.
*
* 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 test = new equinix.metal.Vlan("test", {
* description: "test VLAN in SV",
* metro: "sv",
* projectId: projectId,
* });
* const testGateway = new equinix.metal.Gateway("testGateway", {
* projectId: projectId,
* vlanId: test.id,
* privateIpv4SubnetSize: 8,
* });
* ```
* ### example 2
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@equinix-labs/pulumi-equinix";
*
* const test = new equinix.metal.Vlan("test", {
* description: "test VLAN in SV",
* metro: "sv",
* projectId: projectId,
* });
* const test1 = new equinix.metal.ReservedIpBlock("test1", {
* projectId: projectId,
* metro: "sv",
* quantity: 8,
* });
* const testGateway = new equinix.metal.Gateway("testGateway", {
* projectId: projectId,
* vlanId: test.id,
* ipReservationId: testEquinixMetalReservedIpBlock.id,
* });
* ```
*/
class Gateway extends pulumi.CustomResource {
/**
* Get an existing Gateway 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 Gateway(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Gateway. 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'] === Gateway.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["ipReservationId"] = state ? state.ipReservationId : undefined;
resourceInputs["privateIpv4SubnetSize"] = state ? state.privateIpv4SubnetSize : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["state"] = state ? state.state : undefined;
resourceInputs["timeouts"] = state ? state.timeouts : undefined;
resourceInputs["vlanId"] = state ? state.vlanId : undefined;
resourceInputs["vrfId"] = state ? state.vrfId : undefined;
}
else {
const args = argsOrState;
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.vlanId === undefined) && !opts.urn) {
throw new Error("Missing required property 'vlanId'");
}
resourceInputs["ipReservationId"] = args ? args.ipReservationId : undefined;
resourceInputs["privateIpv4SubnetSize"] = args ? args.privateIpv4SubnetSize : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["timeouts"] = args ? args.timeouts : undefined;
resourceInputs["vlanId"] = args ? args.vlanId : undefined;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["vrfId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Gateway.__pulumiType, name, resourceInputs, opts);
}
}
exports.Gateway = Gateway;
/** @internal */
Gateway.__pulumiType = 'equinix:metal/gateway:Gateway';
//# sourceMappingURL=gateway.js.map