@cuemby/equinix
Version:
A Pulumi package for creating and managing equinix cloud resources.
111 lines • 4.75 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.MetalGateway = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Use this resource to create Metal Gateway resources in Equinix Metal.
*
* > VRF features are not generally available. The interfaces related to VRF resources may change ahead of general availability.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@cuemby/equinix";
*
* // Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
* const testMetalVlan = new equinix.MetalVlan("testMetalVlan", {
* description: "test VLAN in SV",
* metro: "sv",
* projectId: local.project_id,
* });
* const testMetalGateway = new equinix.MetalGateway("testMetalGateway", {
* projectId: local.project_id,
* vlanId: testMetalVlan.id,
* privateIpv4SubnetSize: 8,
* });
* ```
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as equinix from "@cuemby/equinix";
*
* // Create Metal Gateway for a VLAN and reserved IP address block
* const testMetalVlan = new equinix.MetalVlan("testMetalVlan", {
* description: "test VLAN in SV",
* metro: "sv",
* projectId: local.project_id,
* });
* const testMetalReservedIPBlock = new equinix.MetalReservedIPBlock("testMetalReservedIPBlock", {
* projectId: local.project_id,
* metro: "sv",
* quantity: 2,
* });
* const testMetalGateway = new equinix.MetalGateway("testMetalGateway", {
* projectId: local.project_id,
* vlanId: testMetalVlan.id,
* ipReservationId: testMetalReservedIPBlock.id,
* });
* ```
*/
class MetalGateway extends pulumi.CustomResource {
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["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["vlanId"] = args ? args.vlanId : undefined;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["vrfId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MetalGateway.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing MetalGateway 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 MetalGateway(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of MetalGateway. 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'] === MetalGateway.__pulumiType;
}
}
exports.MetalGateway = MetalGateway;
/** @internal */
MetalGateway.__pulumiType = 'equinix:index/metalGateway:MetalGateway';
//# sourceMappingURL=metalGateway.js.map