Equinix v0.19.0 published on Thursday, Oct 24, 2024 by Equinix
equinix.metal.getGateway
Explore with Pulumi AI
Use this datasource to retrieve Metal Gateway resources in Equinix Metal.
See the Virtual Routing and Forwarding documentation for product details and API reference material.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@equinix-labs/pulumi-equinix";
import * as equinix from "@pulumi/equinix";
// Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
const testVlan = new equinix.metal.Vlan("testVlan", {
description: "test VLAN in SV",
metro: "sv",
projectId: local.project_id,
});
const testGateway = equinix.metal.getGateway({
gatewayId: local.gateway_id,
});
import pulumi
import pulumi_equinix as equinix
# Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
test_vlan = equinix.metal.Vlan("testVlan",
description="test VLAN in SV",
metro="sv",
project_id=local["project_id"])
test_gateway = equinix.metal.get_gateway(gateway_id=local["gateway_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 {
// Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
_, err := metal.NewVlan(ctx, "testVlan", &metal.VlanArgs{
Description: pulumi.String("test VLAN in SV"),
Metro: pulumi.String("sv"),
ProjectId: pulumi.Any(local.Project_id),
})
if err != nil {
return err
}
_, err = metal.LookupGateway(ctx, &metal.LookupGatewayArgs{
GatewayId: local.Gateway_id,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
// Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
var testVlan = new Equinix.Metal.Vlan("testVlan", new()
{
Description = "test VLAN in SV",
Metro = "sv",
ProjectId = local.Project_id,
});
var testGateway = Equinix.Metal.GetGateway.Invoke(new()
{
GatewayId = local.Gateway_id,
});
});
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.MetalFunctions;
import com.pulumi.equinix.metal.inputs.GetGatewayArgs;
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) {
// Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
var testVlan = new Vlan("testVlan", VlanArgs.builder()
.description("test VLAN in SV")
.metro("sv")
.projectId(local.project_id())
.build());
final var testGateway = MetalFunctions.getGateway(GetGatewayArgs.builder()
.gatewayId(local.gateway_id())
.build());
}
}
resources:
# Create Metal Gateway for a VLAN with a private IPv4 block with 8 IP addresses
testVlan:
type: equinix:metal:Vlan
properties:
description: test VLAN in SV
metro: sv
projectId: ${local.project_id}
variables:
testGateway:
fn::invoke:
Function: equinix:metal:getGateway
Arguments:
gatewayId: ${local.gateway_id}
Using getGateway
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getGateway(args: GetGatewayArgs, opts?: InvokeOptions): Promise<GetGatewayResult>
function getGatewayOutput(args: GetGatewayOutputArgs, opts?: InvokeOptions): Output<GetGatewayResult>
def get_gateway(gateway_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetGatewayResult
def get_gateway_output(gateway_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetGatewayResult]
func LookupGateway(ctx *Context, args *LookupGatewayArgs, opts ...InvokeOption) (*LookupGatewayResult, error)
func LookupGatewayOutput(ctx *Context, args *LookupGatewayOutputArgs, opts ...InvokeOption) LookupGatewayResultOutput
> Note: This function is named LookupGateway
in the Go SDK.
public static class GetGateway
{
public static Task<GetGatewayResult> InvokeAsync(GetGatewayArgs args, InvokeOptions? opts = null)
public static Output<GetGatewayResult> Invoke(GetGatewayInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: equinix:metal/getGateway:getGateway
arguments:
# arguments dictionary
The following arguments are supported:
- Gateway
Id string - UUID of the metal gateway resource to retrieve.
- Gateway
Id string - UUID of the metal gateway resource to retrieve.
- gateway
Id String - UUID of the metal gateway resource to retrieve.
- gateway
Id string - UUID of the metal gateway resource to retrieve.
- gateway_
id str - UUID of the metal gateway resource to retrieve.
- gateway
Id String - UUID of the metal gateway resource to retrieve.
getGateway Result
The following output properties are available:
- Gateway
Id string - Id string
- Ip
Reservation stringId - UUID of IP reservation block bound to the gateway.
- Private
Ipv4Subnet intSize - Size of the private IPv4 subnet bound to this metal gateway. One of
8
,16
,32
,64
,128
. - Project
Id string - UUID of the project where the gateway is scoped to.
- State string
- Status of the gateway resource.
- 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.
- Gateway
Id string - Id string
- Ip
Reservation stringId - UUID of IP reservation block bound to the gateway.
- Private
Ipv4Subnet intSize - Size of the private IPv4 subnet bound to this metal gateway. One of
8
,16
,32
,64
,128
. - Project
Id string - UUID of the project where the gateway is scoped to.
- State string
- Status of the gateway resource.
- 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.
- gateway
Id String - id String
- ip
Reservation StringId - UUID of IP reservation block bound to the gateway.
- private
Ipv4Subnet IntegerSize - Size of the private IPv4 subnet bound to this metal gateway. One of
8
,16
,32
,64
,128
. - project
Id String - UUID of the project where the gateway is scoped to.
- state String
- Status of the gateway resource.
- 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.
- gateway
Id string - id string
- ip
Reservation stringId - UUID of IP reservation block bound to the gateway.
- private
Ipv4Subnet numberSize - Size of the private IPv4 subnet bound to this metal gateway. One of
8
,16
,32
,64
,128
. - project
Id string - UUID of the project where the gateway is scoped to.
- state string
- Status of the gateway resource.
- 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.
- gateway_
id str - id str
- ip_
reservation_ strid - UUID of IP reservation block bound to the gateway.
- private_
ipv4_ intsubnet_ size - Size of the private IPv4 subnet bound to this metal gateway. One of
8
,16
,32
,64
,128
. - project_
id str - UUID of the project where the gateway is scoped to.
- state str
- Status of the gateway resource.
- 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.
- gateway
Id String - id String
- ip
Reservation StringId - UUID of IP reservation block bound to the gateway.
- private
Ipv4Subnet NumberSize - Size of the private IPv4 subnet bound to this metal gateway. One of
8
,16
,32
,64
,128
. - project
Id String - UUID of the project where the gateway is scoped to.
- state String
- Status of the gateway resource.
- 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.
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
equinix
Terraform Provider.