1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getVPNGateway
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.compute.getVPNGateway

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    Get a VPN gateway within GCE from its name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const my-vpn-gateway = gcp.compute.getVPNGateway({
        name: "vpn-gateway-us-east1",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    my_vpn_gateway = gcp.compute.get_vpn_gateway(name="vpn-gateway-us-east1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.LookupVPNGateway(ctx, &compute.LookupVPNGatewayArgs{
    			Name: "vpn-gateway-us-east1",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var my_vpn_gateway = Gcp.Compute.GetVPNGateway.Invoke(new()
        {
            Name = "vpn-gateway-us-east1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetVPNGatewayArgs;
    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) {
            final var my-vpn-gateway = ComputeFunctions.getVPNGateway(GetVPNGatewayArgs.builder()
                .name("vpn-gateway-us-east1")
                .build());
    
        }
    }
    
    variables:
      my-vpn-gateway:
        fn::invoke:
          Function: gcp:compute:getVPNGateway
          Arguments:
            name: vpn-gateway-us-east1
    

    Using getVPNGateway

    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 getVPNGateway(args: GetVPNGatewayArgs, opts?: InvokeOptions): Promise<GetVPNGatewayResult>
    function getVPNGatewayOutput(args: GetVPNGatewayOutputArgs, opts?: InvokeOptions): Output<GetVPNGatewayResult>
    def get_vpn_gateway(name: Optional[str] = None,
                        project: Optional[str] = None,
                        region: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetVPNGatewayResult
    def get_vpn_gateway_output(name: Optional[pulumi.Input[str]] = None,
                        project: Optional[pulumi.Input[str]] = None,
                        region: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetVPNGatewayResult]
    func LookupVPNGateway(ctx *Context, args *LookupVPNGatewayArgs, opts ...InvokeOption) (*LookupVPNGatewayResult, error)
    func LookupVPNGatewayOutput(ctx *Context, args *LookupVPNGatewayOutputArgs, opts ...InvokeOption) LookupVPNGatewayResultOutput

    > Note: This function is named LookupVPNGateway in the Go SDK.

    public static class GetVPNGateway 
    {
        public static Task<GetVPNGatewayResult> InvokeAsync(GetVPNGatewayArgs args, InvokeOptions? opts = null)
        public static Output<GetVPNGatewayResult> Invoke(GetVPNGatewayInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVPNGatewayResult> getVPNGateway(GetVPNGatewayArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:compute/getVPNGateway:getVPNGateway
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the VPN gateway.


    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    The region in which the resource belongs. If it is not provided, the project region is used.
    Name string
    The name of the VPN gateway.


    Project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    The region in which the resource belongs. If it is not provided, the project region is used.
    name String
    The name of the VPN gateway.


    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    The region in which the resource belongs. If it is not provided, the project region is used.
    name string
    The name of the VPN gateway.


    project string
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    The region in which the resource belongs. If it is not provided, the project region is used.
    name str
    The name of the VPN gateway.


    project str
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    The region in which the resource belongs. If it is not provided, the project region is used.
    name String
    The name of the VPN gateway.


    project String
    The project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    The region in which the resource belongs. If it is not provided, the project region is used.

    getVPNGateway Result

    The following output properties are available:

    Description string
    Description of this VPN gateway.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Network string
    The network of this VPN gateway.
    Project string
    Region string
    Region of this VPN gateway.
    SelfLink string
    The URI of the resource.
    Description string
    Description of this VPN gateway.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Network string
    The network of this VPN gateway.
    Project string
    Region string
    Region of this VPN gateway.
    SelfLink string
    The URI of the resource.
    description String
    Description of this VPN gateway.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    network String
    The network of this VPN gateway.
    project String
    region String
    Region of this VPN gateway.
    selfLink String
    The URI of the resource.
    description string
    Description of this VPN gateway.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    network string
    The network of this VPN gateway.
    project string
    region string
    Region of this VPN gateway.
    selfLink string
    The URI of the resource.
    description str
    Description of this VPN gateway.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    network str
    The network of this VPN gateway.
    project str
    region str
    Region of this VPN gateway.
    self_link str
    The URI of the resource.
    description String
    Description of this VPN gateway.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    network String
    The network of this VPN gateway.
    project String
    region String
    Region of this VPN gateway.
    selfLink String
    The URI of the resource.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi