NetworkEndpointGroup

class NetworkEndpointGroup : KotlinCustomResource

Network endpoint groups (NEGs) are zonal resources that represent collections of IP address and port combinations for GCP resources within a single subnet. Each IP address and port combination is called a network endpoint. Network endpoint groups can be used as backends in backend services for HTTP(S), TCP proxy, and SSL proxy load balancers. You cannot use NEGs as a backend with internal load balancers. Because NEG backends allow you to specify IP addresses and ports, you can distribute traffic in a granular fashion among applications or containers running within VM instances. Recreating a network endpoint group that's in use by another resource will give a resourceInUseByAnotherResource error. Use lifecycle.create_before_destroy to avoid this type of error. To get more information about NetworkEndpointGroup, see:

Example Usage

Network Endpoint Group

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.Subnetwork;
import com.pulumi.gcp.compute.SubnetworkArgs;
import com.pulumi.gcp.compute.NetworkEndpointGroup;
import com.pulumi.gcp.compute.NetworkEndpointGroupArgs;
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) {
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build());
var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
.ipCidrRange("10.0.0.0/16")
.region("us-central1")
.network(defaultNetwork.id())
.build());
var neg = new NetworkEndpointGroup("neg", NetworkEndpointGroupArgs.builder()
.network(defaultNetwork.id())
.subnetwork(defaultSubnetwork.id())
.defaultPort("90")
.zone("us-central1-a")
.build());
}
}

Network Endpoint Group Non Gcp

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkEndpointGroup;
import com.pulumi.gcp.compute.NetworkEndpointGroupArgs;
import com.pulumi.gcp.compute.NetworkEndpoint;
import com.pulumi.gcp.compute.NetworkEndpointArgs;
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) {
var default_ = new Network("default");
var neg = new NetworkEndpointGroup("neg", NetworkEndpointGroupArgs.builder()
.network(default_.id())
.defaultPort("90")
.zone("us-central1-a")
.networkEndpointType("NON_GCP_PRIVATE_IP_PORT")
.build());
var default_endpoint = new NetworkEndpoint("default-endpoint", NetworkEndpointArgs.builder()
.networkEndpointGroup(neg.name())
.port(neg.defaultPort())
.ipAddress("127.0.0.1")
.build());
}
}

Import

NetworkEndpointGroup can be imported using any of these accepted formats

$ pulumi import gcp:compute/networkEndpointGroup:NetworkEndpointGroup default projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{name}}
$ pulumi import gcp:compute/networkEndpointGroup:NetworkEndpointGroup default {{project}}/{{zone}}/{{name}}
$ pulumi import gcp:compute/networkEndpointGroup:NetworkEndpointGroup default {{zone}}/{{name}}
$ pulumi import gcp:compute/networkEndpointGroup:NetworkEndpointGroup default {{name}}

Properties

Link copied to clipboard
val defaultPort: Output<Int>?

The default port used if the port number is not specified in the network endpoint.

Link copied to clipboard
val description: Output<String>?

An optional description of this resource. Provide this property when you create the resource.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.

Link copied to clipboard
val network: Output<String>

The network to which all network endpoints in the NEG belong. Uses "default" project network if unspecified.

Link copied to clipboard

Type of network endpoints in this network endpoint group. NON_GCP_PRIVATE_IP_PORT is used for hybrid connectivity network endpoint groups (see https://cloud.google.com/load-balancing/docs/hybrid). Note that NON_GCP_PRIVATE_IP_PORT can only be used with Backend Services that 1) have the following load balancing schemes: EXTERNAL, EXTERNAL_MANAGED, INTERNAL_MANAGED, and INTERNAL_SELF_MANAGED and 2) support the RATE or CONNECTION balancing modes. Possible values include: GCE_VM_IP, GCE_VM_IP_PORT, and NON_GCP_PRIVATE_IP_PORT. Default value is GCE_VM_IP_PORT. Possible values are: GCE_VM_IP, GCE_VM_IP_PORT, NON_GCP_PRIVATE_IP_PORT.

Link copied to clipboard
val project: Output<String>

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val selfLink: Output<String>

The URI of the created resource.

Link copied to clipboard
val size: Output<Int>

Number of network endpoints in the network endpoint group.

Link copied to clipboard
val subnetwork: Output<String>?

Optional subnetwork to which all network endpoints in the NEG belong.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zone: Output<String>

Zone where the network endpoint group is located.