equinix.metal.Gateway
Explore with Pulumi AI
Use this resource to create Metal Gateway resources in Equinix Metal.
See the Virtual Routing and Forwarding documentation for product details and API reference material.
Example Usage
example 1
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var test = new Equinix.Metal.Vlan("test", new()
{
Description = "test VLAN in SV",
Metro = "sv",
ProjectId = projectId,
});
var testGateway = new Equinix.Metal.Gateway("testGateway", new()
{
ProjectId = projectId,
VlanId = test.Id,
PrivateIpv4SubnetSize = 8,
});
});
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := metal.NewVlan(ctx, "test", &metal.VlanArgs{
Description: pulumi.String("test VLAN in SV"),
Metro: pulumi.String("sv"),
ProjectId: pulumi.Any(projectId),
})
if err != nil {
return err
}
_, err = metal.NewGateway(ctx, "testGateway", &metal.GatewayArgs{
ProjectId: pulumi.Any(projectId),
VlanId: test.ID(),
PrivateIpv4SubnetSize: pulumi.Int(8),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.Vlan;
import com.pulumi.equinix.metal.VlanArgs;
import com.pulumi.equinix.metal.Gateway;
import com.pulumi.equinix.metal.GatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new Vlan("test", VlanArgs.builder()
.description("test VLAN in SV")
.metro("sv")
.projectId(projectId)
.build());
var testGateway = new Gateway("testGateway", GatewayArgs.builder()
.projectId(projectId)
.vlanId(test.id())
.privateIpv4SubnetSize(8)
.build());
}
}
import pulumi
import pulumi_equinix as equinix
test = equinix.metal.Vlan("test",
description="test VLAN in SV",
metro="sv",
project_id=project_id)
test_gateway = equinix.metal.Gateway("testGateway",
project_id=project_id,
vlan_id=test.id,
private_ipv4_subnet_size=8)
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,
});
resources:
# Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
test:
type: equinix:metal:Vlan
properties:
description: test VLAN in SV
metro: sv
projectId: ${projectId}
testGateway:
type: equinix:metal:Gateway
name: test
properties:
projectId: ${projectId}
vlanId: ${test.id}
privateIpv4SubnetSize: 8
example 2
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var test = new Equinix.Metal.Vlan("test", new()
{
Description = "test VLAN in SV",
Metro = "sv",
ProjectId = projectId,
});
var test1 = new Equinix.Metal.ReservedIpBlock("test1", new()
{
ProjectId = projectId,
Metro = "sv",
Quantity = 8,
});
var testGateway = new Equinix.Metal.Gateway("testGateway", new()
{
ProjectId = projectId,
VlanId = test.Id,
IpReservationId = testEquinixMetalReservedIpBlock.Id,
});
});
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := metal.NewVlan(ctx, "test", &metal.VlanArgs{
Description: pulumi.String("test VLAN in SV"),
Metro: pulumi.String("sv"),
ProjectId: pulumi.Any(projectId),
})
if err != nil {
return err
}
_, err = metal.NewReservedIpBlock(ctx, "test1", &metal.ReservedIpBlockArgs{
ProjectId: pulumi.Any(projectId),
Metro: pulumi.String("sv"),
Quantity: pulumi.Int(8),
})
if err != nil {
return err
}
_, err = metal.NewGateway(ctx, "testGateway", &metal.GatewayArgs{
ProjectId: pulumi.Any(projectId),
VlanId: test.ID(),
IpReservationId: pulumi.Any(testEquinixMetalReservedIpBlock.Id),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.Vlan;
import com.pulumi.equinix.metal.VlanArgs;
import com.pulumi.equinix.metal.ReservedIpBlock;
import com.pulumi.equinix.metal.ReservedIpBlockArgs;
import com.pulumi.equinix.metal.Gateway;
import com.pulumi.equinix.metal.GatewayArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new Vlan("test", VlanArgs.builder()
.description("test VLAN in SV")
.metro("sv")
.projectId(projectId)
.build());
var test1 = new ReservedIpBlock("test1", ReservedIpBlockArgs.builder()
.projectId(projectId)
.metro("sv")
.quantity(8)
.build());
var testGateway = new Gateway("testGateway", GatewayArgs.builder()
.projectId(projectId)
.vlanId(test.id())
.ipReservationId(testEquinixMetalReservedIpBlock.id())
.build());
}
}
import pulumi
import pulumi_equinix as equinix
test = equinix.metal.Vlan("test",
description="test VLAN in SV",
metro="sv",
project_id=project_id)
test1 = equinix.metal.ReservedIpBlock("test1",
project_id=project_id,
metro="sv",
quantity=8)
test_gateway = equinix.metal.Gateway("testGateway",
project_id=project_id,
vlan_id=test.id,
ip_reservation_id=test_equinix_metal_reserved_ip_block["id"])
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,
});
resources:
# Create Metal Gateway for a VLAN and reserved IP address block
test:
type: equinix:metal:Vlan
properties:
description: test VLAN in SV
metro: sv
projectId: ${projectId}
test1:
type: equinix:metal:ReservedIpBlock
properties:
projectId: ${projectId}
metro: sv
quantity: 8
testGateway:
type: equinix:metal:Gateway
name: test
properties:
projectId: ${projectId}
vlanId: ${test.id}
ipReservationId: ${testEquinixMetalReservedIpBlock.id}
Create Gateway Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Gateway(name: string, args: GatewayArgs, opts?: CustomResourceOptions);
@overload
def Gateway(resource_name: str,
args: GatewayArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Gateway(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
vlan_id: Optional[str] = None,
ip_reservation_id: Optional[str] = None,
private_ipv4_subnet_size: Optional[int] = None,
timeouts: Optional[GatewayTimeoutsArgs] = None)
func NewGateway(ctx *Context, name string, args GatewayArgs, opts ...ResourceOption) (*Gateway, error)
public Gateway(string name, GatewayArgs args, CustomResourceOptions? opts = null)
public Gateway(String name, GatewayArgs args)
public Gateway(String name, GatewayArgs args, CustomResourceOptions options)
type: equinix:metal:Gateway
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GatewayArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var gatewayResource = new Equinix.Metal.Gateway("gatewayResource", new()
{
ProjectId = "string",
VlanId = "string",
IpReservationId = "string",
PrivateIpv4SubnetSize = 0,
Timeouts = new Equinix.Metal.Inputs.GatewayTimeoutsArgs
{
Delete = "string",
},
});
example, err := metal.NewGateway(ctx, "gatewayResource", &metal.GatewayArgs{
ProjectId: pulumi.String("string"),
VlanId: pulumi.String("string"),
IpReservationId: pulumi.String("string"),
PrivateIpv4SubnetSize: pulumi.Int(0),
Timeouts: &metal.GatewayTimeoutsArgs{
Delete: pulumi.String("string"),
},
})
var gatewayResource = new Gateway("gatewayResource", GatewayArgs.builder()
.projectId("string")
.vlanId("string")
.ipReservationId("string")
.privateIpv4SubnetSize(0)
.timeouts(GatewayTimeoutsArgs.builder()
.delete("string")
.build())
.build());
gateway_resource = equinix.metal.Gateway("gatewayResource",
project_id="string",
vlan_id="string",
ip_reservation_id="string",
private_ipv4_subnet_size=0,
timeouts=equinix.metal.GatewayTimeoutsArgs(
delete="string",
))
const gatewayResource = new equinix.metal.Gateway("gatewayResource", {
projectId: "string",
vlanId: "string",
ipReservationId: "string",
privateIpv4SubnetSize: 0,
timeouts: {
"delete": "string",
},
});
type: equinix:metal:Gateway
properties:
ipReservationId: string
privateIpv4SubnetSize: 0
projectId: string
timeouts:
delete: string
vlanId: string
Gateway Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Gateway resource accepts the following input properties:
- Project
Id string - UUID of the project where the gateway is scoped to.
- Vlan
Id string - UUID of the VLAN where the gateway is scoped to.
- Ip
Reservation stringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - Private
Ipv4Subnet intSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - Timeouts
Gateway
Timeouts
- Project
Id string - UUID of the project where the gateway is scoped to.
- Vlan
Id string - UUID of the VLAN where the gateway is scoped to.
- Ip
Reservation stringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - Private
Ipv4Subnet intSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - Timeouts
Gateway
Timeouts Args
- project
Id String - UUID of the project where the gateway is scoped to.
- vlan
Id String - UUID of the VLAN where the gateway is scoped to.
- ip
Reservation StringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private
Ipv4Subnet IntegerSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - timeouts
Gateway
Timeouts
- project
Id string - UUID of the project where the gateway is scoped to.
- vlan
Id string - UUID of the VLAN where the gateway is scoped to.
- ip
Reservation stringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private
Ipv4Subnet numberSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - timeouts
Gateway
Timeouts
- project_
id str - UUID of the project where the gateway is scoped to.
- vlan_
id str - UUID of the VLAN where the gateway is scoped to.
- ip_
reservation_ strid - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private_
ipv4_ intsubnet_ size - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - timeouts
Gateway
Timeouts Args
- project
Id String - UUID of the project where the gateway is scoped to.
- vlan
Id String - UUID of the VLAN where the gateway is scoped to.
- ip
Reservation StringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private
Ipv4Subnet NumberSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Gateway resource produces the following output properties:
Look up Existing Gateway Resource
Get an existing Gateway resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GatewayState, opts?: CustomResourceOptions): Gateway
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
ip_reservation_id: Optional[str] = None,
private_ipv4_subnet_size: Optional[int] = None,
project_id: Optional[str] = None,
state: Optional[str] = None,
timeouts: Optional[GatewayTimeoutsArgs] = None,
vlan_id: Optional[str] = None,
vrf_id: Optional[str] = None) -> Gateway
func GetGateway(ctx *Context, name string, id IDInput, state *GatewayState, opts ...ResourceOption) (*Gateway, error)
public static Gateway Get(string name, Input<string> id, GatewayState? state, CustomResourceOptions? opts = null)
public static Gateway get(String name, Output<String> id, GatewayState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Ip
Reservation stringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - Private
Ipv4Subnet intSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - Project
Id string - UUID of the project where the gateway is scoped to.
- State string
- Status of the gateway resource.
- Timeouts
Gateway
Timeouts - Vlan
Id string - UUID of the VLAN where the gateway is scoped to.
- Vrf
Id string - UUID of the VRF associated with the IP Reservation
- Ip
Reservation stringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - Private
Ipv4Subnet intSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - Project
Id string - UUID of the project where the gateway is scoped to.
- State string
- Status of the gateway resource.
- Timeouts
Gateway
Timeouts Args - Vlan
Id string - UUID of the VLAN where the gateway is scoped to.
- Vrf
Id string - UUID of the VRF associated with the IP Reservation
- ip
Reservation StringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private
Ipv4Subnet IntegerSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - project
Id String - UUID of the project where the gateway is scoped to.
- state String
- Status of the gateway resource.
- timeouts
Gateway
Timeouts - vlan
Id String - UUID of the VLAN where the gateway is scoped to.
- vrf
Id String - UUID of the VRF associated with the IP Reservation
- ip
Reservation stringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private
Ipv4Subnet numberSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - project
Id string - UUID of the project where the gateway is scoped to.
- state string
- Status of the gateway resource.
- timeouts
Gateway
Timeouts - vlan
Id string - UUID of the VLAN where the gateway is scoped to.
- vrf
Id string - UUID of the VRF associated with the IP Reservation
- ip_
reservation_ strid - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private_
ipv4_ intsubnet_ size - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - project_
id str - UUID of the project where the gateway is scoped to.
- state str
- Status of the gateway resource.
- timeouts
Gateway
Timeouts Args - vlan_
id str - UUID of the VLAN where the gateway is scoped to.
- vrf_
id str - UUID of the VRF associated with the IP Reservation
- ip
Reservation StringId - UUID of Public or VRF IP Reservation to associate with the gateway, the reservation must be in the same metro as the VLAN, conflicts with
private_ipv4_subnet_size
. - private
Ipv4Subnet NumberSize - Size of the private IPv4 subnet to create for this metal gateway, must be one of
8
,16
,32
,64
,128
. Conflicts withip_reservation_id
. - project
Id String - UUID of the project where the gateway is scoped to.
- state String
- Status of the gateway resource.
- timeouts Property Map
- vlan
Id String - UUID of the VLAN where the gateway is scoped to.
- vrf
Id String - UUID of the VRF associated with the IP Reservation
Supporting Types
GatewayTimeouts, GatewayTimeoutsArgs
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- Delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- delete string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- delete str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- delete String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
equinix
Terraform Provider.