Google Cloud v8.27.0 published on Thursday, Apr 17, 2025 by Pulumi
gcp.compute.getNetworkEndpointGroup
Explore with Pulumi AI
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",
});
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")
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
	})
}
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",
    });
});
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());
    }
}
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
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>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]func LookupNetworkEndpointGroup(ctx *Context, args *LookupNetworkEndpointGroupArgs, opts ...InvokeOption) (*LookupNetworkEndpointGroupResult, error)
func LookupNetworkEndpointGroupOutput(ctx *Context, args *LookupNetworkEndpointGroupOutputArgs, opts ...InvokeOption) LookupNetworkEndpointGroupResultOutput> 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)
}public static CompletableFuture<GetNetworkEndpointGroupResult> getNetworkEndpointGroup(GetNetworkEndpointGroupArgs args, InvokeOptions options)
public static Output<GetNetworkEndpointGroupResult> getNetworkEndpointGroup(GetNetworkEndpointGroupArgs args, InvokeOptions options)
fn::invoke:
  function: gcp:compute/getNetworkEndpointGroup:getNetworkEndpointGroup
  arguments:
    # arguments dictionaryThe following arguments are supported:
getNetworkEndpointGroup Result
The following output properties are available:
- Default
Port 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.
 - Network
Endpoint stringType  - 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
 - Self
Link string - Zone string
 
- Default
Port 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.
 - Network
Endpoint stringType  - 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
 - Self
Link string - Zone string
 
- default
Port 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.
 - network
Endpoint StringType  - 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
 - self
Link String - zone String
 
- default
Port 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.
 - network
Endpoint stringType  - 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
 - self
Link 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_ strtype  - 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
 
- default
Port 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.
 - network
Endpoint StringType  - 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
 - self
Link 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-betaTerraform Provider.