1. Registry
  2. Packages
  3. Google Cloud (GCP)
  4. API Docs
  5. networkservices
  6. getGateway
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi
gcp logo
Viewing docs for Google Cloud v10.2.0
published on Tuesday, Oct 20, 2026 by Pulumi

    Get information about a Network Services Gateway.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = gcp.networkservices.getGateway({
        location: defaultGoogleNetworkServicesGateway.location,
        name: defaultGoogleNetworkServicesGateway.name,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.networkservices.get_gateway(location=default_google_network_services_gateway["location"],
        name=default_google_network_services_gateway["name"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v10/go/gcp/networkservices"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := networkservices.LookupGateway(ctx, &networkservices.LookupGatewayArgs{
    			Location: defaultGoogleNetworkServicesGateway.Location,
    			Name:     defaultGoogleNetworkServicesGateway.Name,
    		}, 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 @default = Gcp.NetworkServices.GetGateway.Invoke(new()
        {
            Location = defaultGoogleNetworkServicesGateway.Location,
            Name = defaultGoogleNetworkServicesGateway.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networkservices.NetworkservicesFunctions;
    import com.pulumi.gcp.networkservices.inputs.GetGatewayArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 default = NetworkservicesFunctions.getGateway(GetGatewayArgs.builder()
                .location(defaultGoogleNetworkServicesGateway.get("location"))
                .name(defaultGoogleNetworkServicesGateway.get("name"))
                .build());
    
        }
    }
    
    variables:
      default:
        fn::invoke:
          function: gcp:networkservices:getGateway
          arguments:
            location: ${defaultGoogleNetworkServicesGateway.location}
            name: ${defaultGoogleNetworkServicesGateway.name}
    
    terraform {
      required_providers {
        gcp = {
          source = "pulumi/gcp"
        }
      }
    }
    
    data "gcp_networkservices_gateway" "default" {
      location = defaultGoogleNetworkServicesGateway.location
      name     = defaultGoogleNetworkServicesGateway.name
    }
    

    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?: InvokeOutputOptions): Output<GetGatewayResult>
    def get_gateway(location: Optional[str] = None,
                    name: Optional[str] = None,
                    project: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetGatewayResult
    def get_gateway_output(location: pulumi.Input[Optional[str]] = None,
                    name: pulumi.Input[Optional[str]] = None,
                    project: pulumi.Input[Optional[str]] = None,
                    opts: Optional[InvokeOutputOptions] = 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 Output<GetGatewayResult> Invoke(GetGatewayInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
    public static Output<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOptions options)
    public static Output<GetGatewayResult> getGateway(GetGatewayArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: gcp:networkservices/getGateway:getGateway
      arguments:
        # arguments dictionary
    data "gcp_networkservices_get_gateway" "name" {
        # arguments
    }

    The following arguments are supported:

    Location string
    The location of the gateway. The default value is global.
    Name string
    Name of the Gateway resource.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Location string
    The location of the gateway. The default value is global.
    Name string
    Name of the Gateway resource.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location of the gateway. The default value is global.
    name string
    Name of the Gateway resource.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the gateway. The default value is global.
    name String
    Name of the Gateway resource.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location string
    The location of the gateway. The default value is global.
    name string
    Name of the Gateway resource.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location str
    The location of the gateway. The default value is global.
    name str
    Name of the Gateway resource.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    location String
    The location of the gateway. The default value is global.
    name String
    Name of the Gateway resource.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

    getGateway Result

    The following output properties are available:

    Addresses List<string>
    AllPorts bool
    AllowGlobalAccess bool
    CertificateUrls List<string>
    CreateTime string
    DeleteSwgAutogenRouterOnDestroy bool
    DeletionPolicy string
    Description string
    EffectiveLabels Dictionary<string, string>
    EnvoyHeaders string
    GatewaySecurityPolicy string
    Id string
    The provider-assigned unique ID for this managed resource.
    IpVersion string
    Labels Dictionary<string, string>
    Location string
    Name string
    Network string
    Ports List<int>
    PulumiLabels Dictionary<string, string>
    RoutingMode string
    Scope string
    SelfLink string
    ServerTlsPolicy string
    Subnetwork string
    Type string
    UpdateTime string
    Project string
    Addresses []string
    AllPorts bool
    AllowGlobalAccess bool
    CertificateUrls []string
    CreateTime string
    DeleteSwgAutogenRouterOnDestroy bool
    DeletionPolicy string
    Description string
    EffectiveLabels map[string]string
    EnvoyHeaders string
    GatewaySecurityPolicy string
    Id string
    The provider-assigned unique ID for this managed resource.
    IpVersion string
    Labels map[string]string
    Location string
    Name string
    Network string
    Ports []int
    PulumiLabels map[string]string
    RoutingMode string
    Scope string
    SelfLink string
    ServerTlsPolicy string
    Subnetwork string
    Type string
    UpdateTime string
    Project string
    addresses list(string)
    all_ports bool
    allow_global_access bool
    certificate_urls list(string)
    create_time string
    delete_swg_autogen_router_on_destroy bool
    deletion_policy string
    description string
    effective_labels map(string)
    envoy_headers string
    gateway_security_policy string
    id string
    The provider-assigned unique ID for this managed resource.
    ip_version string
    labels map(string)
    location string
    name string
    network string
    ports list(number)
    pulumi_labels map(string)
    routing_mode string
    scope string
    self_link string
    server_tls_policy string
    subnetwork string
    type string
    update_time string
    project string
    addresses List<String>
    allPorts Boolean
    allowGlobalAccess Boolean
    certificateUrls List<String>
    createTime String
    deleteSwgAutogenRouterOnDestroy Boolean
    deletionPolicy String
    description String
    effectiveLabels Map<String,String>
    envoyHeaders String
    gatewaySecurityPolicy String
    id String
    The provider-assigned unique ID for this managed resource.
    ipVersion String
    labels Map<String,String>
    location String
    name String
    network String
    ports List<Integer>
    pulumiLabels Map<String,String>
    routingMode String
    scope String
    selfLink String
    serverTlsPolicy String
    subnetwork String
    type String
    updateTime String
    project String
    addresses string[]
    allPorts boolean
    allowGlobalAccess boolean
    certificateUrls string[]
    createTime string
    deleteSwgAutogenRouterOnDestroy boolean
    deletionPolicy string
    description string
    effectiveLabels {[key: string]: string}
    envoyHeaders string
    gatewaySecurityPolicy string
    id string
    The provider-assigned unique ID for this managed resource.
    ipVersion string
    labels {[key: string]: string}
    location string
    name string
    network string
    ports number[]
    pulumiLabels {[key: string]: string}
    routingMode string
    scope string
    selfLink string
    serverTlsPolicy string
    subnetwork string
    type string
    updateTime string
    project string
    addresses Sequence[str]
    all_ports bool
    allow_global_access bool
    certificate_urls Sequence[str]
    create_time str
    delete_swg_autogen_router_on_destroy bool
    deletion_policy str
    description str
    effective_labels Mapping[str, str]
    envoy_headers str
    gateway_security_policy str
    id str
    The provider-assigned unique ID for this managed resource.
    ip_version str
    labels Mapping[str, str]
    location str
    name str
    network str
    ports Sequence[int]
    pulumi_labels Mapping[str, str]
    routing_mode str
    scope str
    self_link str
    server_tls_policy str
    subnetwork str
    type str
    update_time str
    project str
    addresses List<String>
    allPorts Boolean
    allowGlobalAccess Boolean
    certificateUrls List<String>
    createTime String
    deleteSwgAutogenRouterOnDestroy Boolean
    deletionPolicy String
    description String
    effectiveLabels Map<String>
    envoyHeaders String
    gatewaySecurityPolicy String
    id String
    The provider-assigned unique ID for this managed resource.
    ipVersion String
    labels Map<String>
    location String
    name String
    network String
    ports List<Number>
    pulumiLabels Map<String>
    routingMode String
    scope String
    selfLink String
    serverTlsPolicy String
    subnetwork String
    type String
    updateTime String
    project String

    Package Details

    Repository
    Google Cloud (GCP) pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Viewing docs for Google Cloud v10.2.0
    published on Tuesday, Oct 20, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial