1. Packages
  2. Equinix
  3. API Docs
  4. metal
  5. getGateway
Equinix v0.18.0 published on Monday, Sep 23, 2024 by Equinix

equinix.metal.getGateway

Explore with Pulumi AI

equinix logo
Equinix v0.18.0 published on Monday, Sep 23, 2024 by Equinix

    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:

    GatewayId string
    UUID of the metal gateway resource to retrieve.
    GatewayId string
    UUID of the metal gateway resource to retrieve.
    gatewayId String
    UUID of the metal gateway resource to retrieve.
    gatewayId string
    UUID of the metal gateway resource to retrieve.
    gateway_id str
    UUID of the metal gateway resource to retrieve.
    gatewayId String
    UUID of the metal gateway resource to retrieve.

    getGateway Result

    The following output properties are available:

    GatewayId string
    Id string
    IpReservationId string
    UUID of IP reservation block bound to the gateway.
    PrivateIpv4SubnetSize int
    Size of the private IPv4 subnet bound to this metal gateway. One of 8, 16, 32, 64, 128.
    ProjectId string
    UUID of the project where the gateway is scoped to.
    State string
    Status of the gateway resource.
    VlanId string
    UUID of the VLAN where the gateway is scoped to.
    VrfId string
    UUID of the VRF associated with the IP Reservation.
    GatewayId string
    Id string
    IpReservationId string
    UUID of IP reservation block bound to the gateway.
    PrivateIpv4SubnetSize int
    Size of the private IPv4 subnet bound to this metal gateway. One of 8, 16, 32, 64, 128.
    ProjectId string
    UUID of the project where the gateway is scoped to.
    State string
    Status of the gateway resource.
    VlanId string
    UUID of the VLAN where the gateway is scoped to.
    VrfId string
    UUID of the VRF associated with the IP Reservation.
    gatewayId String
    id String
    ipReservationId String
    UUID of IP reservation block bound to the gateway.
    privateIpv4SubnetSize Integer
    Size of the private IPv4 subnet bound to this metal gateway. One of 8, 16, 32, 64, 128.
    projectId String
    UUID of the project where the gateway is scoped to.
    state String
    Status of the gateway resource.
    vlanId String
    UUID of the VLAN where the gateway is scoped to.
    vrfId String
    UUID of the VRF associated with the IP Reservation.
    gatewayId string
    id string
    ipReservationId string
    UUID of IP reservation block bound to the gateway.
    privateIpv4SubnetSize number
    Size of the private IPv4 subnet bound to this metal gateway. One of 8, 16, 32, 64, 128.
    projectId string
    UUID of the project where the gateway is scoped to.
    state string
    Status of the gateway resource.
    vlanId string
    UUID of the VLAN where the gateway is scoped to.
    vrfId string
    UUID of the VRF associated with the IP Reservation.
    gateway_id str
    id str
    ip_reservation_id str
    UUID of IP reservation block bound to the gateway.
    private_ipv4_subnet_size int
    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.
    gatewayId String
    id String
    ipReservationId String
    UUID of IP reservation block bound to the gateway.
    privateIpv4SubnetSize Number
    Size of the private IPv4 subnet bound to this metal gateway. One of 8, 16, 32, 64, 128.
    projectId String
    UUID of the project where the gateway is scoped to.
    state String
    Status of the gateway resource.
    vlanId String
    UUID of the VLAN where the gateway is scoped to.
    vrfId 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.
    equinix logo
    Equinix v0.18.0 published on Monday, Sep 23, 2024 by Equinix