Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi
gcp.compute.getVPNGateway
Explore with Pulumi AI
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:
getVPNGateway Result
The following output properties are available:
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.