NetworkEndpointArgs

data class NetworkEndpointArgs(val instance: Output<String>? = null, val ipAddress: Output<String>? = null, val networkEndpointGroup: Output<String>? = null, val port: Output<Int>? = null, val project: Output<String>? = null, val zone: Output<String>? = null) : ConvertibleToJava<NetworkEndpointArgs>

A Network endpoint represents a IP address and port combination that is part of a specific network endpoint group (NEG). NEGs are zonal collections of these endpoints for GCP resources within a single subnet. NOTE: Network endpoints cannot be created outside of a network endpoint group. To get more information about NetworkEndpoint, see:

Example Usage

Network Endpoint

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.GetImageArgs;
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.Instance;
import com.pulumi.gcp.compute.InstanceArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
import com.pulumi.gcp.compute.NetworkEndpoint;
import com.pulumi.gcp.compute.NetworkEndpointArgs;
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) {
final var myImage = ComputeFunctions.getImage(GetImageArgs.builder()
.family("debian-11")
.project("debian-cloud")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.autoCreateSubnetworks(false)
.build());
var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
.ipCidrRange("10.0.0.1/16")
.region("us-central1")
.network(defaultNetwork.id())
.build());
var endpoint_instance = new Instance("endpoint-instance", InstanceArgs.builder()
.machineType("e2-medium")
.bootDisk(InstanceBootDiskArgs.builder()
.initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
.image(myImage.applyValue(getImageResult -> getImageResult.selfLink()))
.build())
.build())
.networkInterfaces(InstanceNetworkInterfaceArgs.builder()
.subnetwork(defaultSubnetwork.id())
.accessConfigs()
.build())
.build());
var default_endpoint = new NetworkEndpoint("default-endpoint", NetworkEndpointArgs.builder()
.networkEndpointGroup(google_compute_network_endpoint_group.neg().name())
.instance(endpoint_instance.name())
.port(google_compute_network_endpoint_group.neg().default_port())
.ipAddress(endpoint_instance.networkInterfaces().applyValue(networkInterfaces -> networkInterfaces[0].networkIp()))
.build());
var group = new NetworkEndpointGroup("group", NetworkEndpointGroupArgs.builder()
.network(defaultNetwork.id())
.subnetwork(defaultSubnetwork.id())
.defaultPort("90")
.zone("us-central1-a")
.build());
}
}

Import

NetworkEndpoint can be imported using any of these accepted formats

$ pulumi import gcp:compute/networkEndpoint:NetworkEndpoint default projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}
$ pulumi import gcp:compute/networkEndpoint:NetworkEndpoint default {{project}}/{{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}
$ pulumi import gcp:compute/networkEndpoint:NetworkEndpoint default {{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}
$ pulumi import gcp:compute/networkEndpoint:NetworkEndpoint default {{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}

Constructors

Link copied to clipboard
constructor(instance: Output<String>? = null, ipAddress: Output<String>? = null, networkEndpointGroup: Output<String>? = null, port: Output<Int>? = null, project: Output<String>? = null, zone: Output<String>? = null)

Properties

Link copied to clipboard
val instance: Output<String>? = null

The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group.

Link copied to clipboard
val ipAddress: Output<String>? = null

IPv4 address of network endpoint. The IP address must belong to a VM in GCE (either the primary IP or as part of an aliased IP range).

Link copied to clipboard
val networkEndpointGroup: Output<String>? = null

The network endpoint group this endpoint is part of.

Link copied to clipboard
val port: Output<Int>? = null

Port number of network endpoint. Note port is required unless the Network Endpoint Group is created with the type of GCE_VM_IP

Link copied to clipboard
val project: Output<String>? = null

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 zone: Output<String>? = null

Zone where the containing network endpoint group is located.

Functions

Link copied to clipboard
open override fun toJava(): NetworkEndpointArgs