get VPNGateway
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",
});
Content copied to clipboard
import pulumi
import pulumi_gcp as gcp
my_vpn_gateway = gcp.compute.get_vpn_gateway(name="vpn-gateway-us-east1")
Content copied to clipboard
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",
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
variables:
my-vpn-gateway:
fn::invoke:
function: gcp:compute:getVPNGateway
arguments:
name: vpn-gateway-us-east1
Content copied to clipboard
Return
A collection of values returned by getVPNGateway.
Parameters
argument
A collection of arguments for invoking getVPNGateway.
suspend fun getVPNGateway(name: String, project: String? = null, region: String? = null): GetVPNGatewayResult
Return
A collection of values returned by getVPNGateway.
Parameters
name
The name of the VPN gateway.
project
The project in which the resource belongs. If it is not provided, the provider project is used.
region
The region in which the resource belongs. If it is not provided, the project region is used.
See also
suspend fun getVPNGateway(argument: suspend GetVPNGatewayPlainArgsBuilder.() -> Unit): GetVPNGatewayResult
Return
A collection of values returned by getVPNGateway.
Parameters
argument
Builder for com.pulumi.gcp.compute.kotlin.inputs.GetVPNGatewayPlainArgs.