1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getNetworkEndpointGroup
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

gcp.compute.getNetworkEndpointGroup

Explore with Pulumi AI

Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi

Use this data source to access a Network Endpoint Group’s attributes.

The NEG may be found by providing either a self_link, or a name and a zone.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const neg1 = gcp.compute.getNetworkEndpointGroup({
    name: "k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
    zone: "us-central1-a",
});
const neg2 = gcp.compute.getNetworkEndpointGroup({
    selfLink: "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
});
Copy
import pulumi
import pulumi_gcp as gcp

neg1 = gcp.compute.get_network_endpoint_group(name="k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
    zone="us-central1-a")
neg2 = gcp.compute.get_network_endpoint_group(self_link="https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
Copy
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.LookupNetworkEndpointGroup(ctx, &compute.LookupNetworkEndpointGroupArgs{
			Name: pulumi.StringRef("k8s1-abcdef01-myns-mysvc-8080-4b6bac43"),
			Zone: pulumi.StringRef("us-central1-a"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = compute.LookupNetworkEndpointGroup(ctx, &compute.LookupNetworkEndpointGroupArgs{
			SelfLink: pulumi.StringRef("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var neg1 = Gcp.Compute.GetNetworkEndpointGroup.Invoke(new()
    {
        Name = "k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
        Zone = "us-central1-a",
    });

    var neg2 = Gcp.Compute.GetNetworkEndpointGroup.Invoke(new()
    {
        SelfLink = "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43",
    });

});
Copy
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.GetNetworkEndpointGroupArgs;
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 neg1 = ComputeFunctions.getNetworkEndpointGroup(GetNetworkEndpointGroupArgs.builder()
            .name("k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
            .zone("us-central1-a")
            .build());

        final var neg2 = ComputeFunctions.getNetworkEndpointGroup(GetNetworkEndpointGroupArgs.builder()
            .selfLink("https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43")
            .build());

    }
}
Copy
variables:
  neg1:
    fn::invoke:
      function: gcp:compute:getNetworkEndpointGroup
      arguments:
        name: k8s1-abcdef01-myns-mysvc-8080-4b6bac43
        zone: us-central1-a
  neg2:
    fn::invoke:
      function: gcp:compute:getNetworkEndpointGroup
      arguments:
        selfLink: https://www.googleapis.com/compute/v1/projects/myproject/zones/us-central1-a/networkEndpointGroups/k8s1-abcdef01-myns-mysvc-8080-4b6bac43
Copy

Using getNetworkEndpointGroup

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 getNetworkEndpointGroup(args: GetNetworkEndpointGroupArgs, opts?: InvokeOptions): Promise<GetNetworkEndpointGroupResult>
function getNetworkEndpointGroupOutput(args: GetNetworkEndpointGroupOutputArgs, opts?: InvokeOptions): Output<GetNetworkEndpointGroupResult>
Copy
def get_network_endpoint_group(name: Optional[str] = None,
                               project: Optional[str] = None,
                               self_link: Optional[str] = None,
                               zone: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetNetworkEndpointGroupResult
def get_network_endpoint_group_output(name: Optional[pulumi.Input[str]] = None,
                               project: Optional[pulumi.Input[str]] = None,
                               self_link: Optional[pulumi.Input[str]] = None,
                               zone: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetNetworkEndpointGroupResult]
Copy
func LookupNetworkEndpointGroup(ctx *Context, args *LookupNetworkEndpointGroupArgs, opts ...InvokeOption) (*LookupNetworkEndpointGroupResult, error)
func LookupNetworkEndpointGroupOutput(ctx *Context, args *LookupNetworkEndpointGroupOutputArgs, opts ...InvokeOption) LookupNetworkEndpointGroupResultOutput
Copy

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

public static class GetNetworkEndpointGroup 
{
    public static Task<GetNetworkEndpointGroupResult> InvokeAsync(GetNetworkEndpointGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetNetworkEndpointGroupResult> Invoke(GetNetworkEndpointGroupInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNetworkEndpointGroupResult> getNetworkEndpointGroup(GetNetworkEndpointGroupArgs args, InvokeOptions options)
public static Output<GetNetworkEndpointGroupResult> getNetworkEndpointGroup(GetNetworkEndpointGroupArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gcp:compute/getNetworkEndpointGroup:getNetworkEndpointGroup
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name string
The Network Endpoint Group name. Provide either this or a self_link.
Project string
The ID of the project to list versions in. If it is not provided, the provider project is used.
SelfLink string
The Network Endpoint Group self_link.
Zone string
The Network Endpoint Group availability zone.
Name string
The Network Endpoint Group name. Provide either this or a self_link.
Project string
The ID of the project to list versions in. If it is not provided, the provider project is used.
SelfLink string
The Network Endpoint Group self_link.
Zone string
The Network Endpoint Group availability zone.
name String
The Network Endpoint Group name. Provide either this or a self_link.
project String
The ID of the project to list versions in. If it is not provided, the provider project is used.
selfLink String
The Network Endpoint Group self_link.
zone String
The Network Endpoint Group availability zone.
name string
The Network Endpoint Group name. Provide either this or a self_link.
project string
The ID of the project to list versions in. If it is not provided, the provider project is used.
selfLink string
The Network Endpoint Group self_link.
zone string
The Network Endpoint Group availability zone.
name str
The Network Endpoint Group name. Provide either this or a self_link.
project str
The ID of the project to list versions in. If it is not provided, the provider project is used.
self_link str
The Network Endpoint Group self_link.
zone str
The Network Endpoint Group availability zone.
name String
The Network Endpoint Group name. Provide either this or a self_link.
project String
The ID of the project to list versions in. If it is not provided, the provider project is used.
selfLink String
The Network Endpoint Group self_link.
zone String
The Network Endpoint Group availability zone.

getNetworkEndpointGroup Result

The following output properties are available:

DefaultPort int
The NEG default port.
Description string
The NEG description.
Id string
The provider-assigned unique ID for this managed resource.
Network string
The network to which all network endpoints in the NEG belong.
NetworkEndpointType string
Type of network endpoints in this network endpoint group.
Size int
Number of network endpoints in the network endpoint group.
Subnetwork string
subnetwork to which all network endpoints in the NEG belong.
Name string
Project string
SelfLink string
Zone string
DefaultPort int
The NEG default port.
Description string
The NEG description.
Id string
The provider-assigned unique ID for this managed resource.
Network string
The network to which all network endpoints in the NEG belong.
NetworkEndpointType string
Type of network endpoints in this network endpoint group.
Size int
Number of network endpoints in the network endpoint group.
Subnetwork string
subnetwork to which all network endpoints in the NEG belong.
Name string
Project string
SelfLink string
Zone string
defaultPort Integer
The NEG default port.
description String
The NEG description.
id String
The provider-assigned unique ID for this managed resource.
network String
The network to which all network endpoints in the NEG belong.
networkEndpointType String
Type of network endpoints in this network endpoint group.
size Integer
Number of network endpoints in the network endpoint group.
subnetwork String
subnetwork to which all network endpoints in the NEG belong.
name String
project String
selfLink String
zone String
defaultPort number
The NEG default port.
description string
The NEG description.
id string
The provider-assigned unique ID for this managed resource.
network string
The network to which all network endpoints in the NEG belong.
networkEndpointType string
Type of network endpoints in this network endpoint group.
size number
Number of network endpoints in the network endpoint group.
subnetwork string
subnetwork to which all network endpoints in the NEG belong.
name string
project string
selfLink string
zone string
default_port int
The NEG default port.
description str
The NEG description.
id str
The provider-assigned unique ID for this managed resource.
network str
The network to which all network endpoints in the NEG belong.
network_endpoint_type str
Type of network endpoints in this network endpoint group.
size int
Number of network endpoints in the network endpoint group.
subnetwork str
subnetwork to which all network endpoints in the NEG belong.
name str
project str
self_link str
zone str
defaultPort Number
The NEG default port.
description String
The NEG description.
id String
The provider-assigned unique ID for this managed resource.
network String
The network to which all network endpoints in the NEG belong.
networkEndpointType String
Type of network endpoints in this network endpoint group.
size Number
Number of network endpoints in the network endpoint group.
subnetwork String
subnetwork to which all network endpoints in the NEG belong.
name String
project String
selfLink String
zone String

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.
Google Cloud v8.23.0 published on Monday, Mar 24, 2025 by Pulumi