1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. getNetworkEndpointGroup
Google Cloud Classic v7.24.0 published on Friday, May 24, 2024 by Pulumi

gcp.compute.getNetworkEndpointGroup

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.24.0 published on Friday, May 24, 2024 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",
    });
    
    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/v7/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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: gcp:compute/getNetworkEndpointGroup:getNetworkEndpointGroup
      arguments:
        # arguments dictionary

    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.
    gcp logo
    Google Cloud Classic v7.24.0 published on Friday, May 24, 2024 by Pulumi