1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. compute
  5. RegionNetworkEndpoint
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.compute.RegionNetworkEndpoint

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    A Region network endpoint represents a IP address/FQDN and port combination that is part of a specific network endpoint group (NEG).

    NOTE: Network endpoints cannot be created outside of a network endpoint group.

    To get more information about RegionNetworkEndpoint, see:

    Example Usage

    Region Network Endpoint Internet Ip Port

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Network("default", {
        name: "network",
        autoCreateSubnetworks: false,
    });
    const group = new gcp.compute.RegionNetworkEndpointGroup("group", {
        name: "ip-port-neg",
        network: _default.id,
        region: "us-central1",
        networkEndpointType: "INTERNET_IP_PORT",
    });
    const region_internet_ip_port_endpoint = new gcp.compute.RegionNetworkEndpoint("region-internet-ip-port-endpoint", {
        regionNetworkEndpointGroup: group.name,
        region: "us-central1",
        ipAddress: "8.8.8.8",
        port: 443,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Network("default",
        name="network",
        auto_create_subnetworks=False)
    group = gcp.compute.RegionNetworkEndpointGroup("group",
        name="ip-port-neg",
        network=default.id,
        region="us-central1",
        network_endpoint_type="INTERNET_IP_PORT")
    region_internet_ip_port_endpoint = gcp.compute.RegionNetworkEndpoint("region-internet-ip-port-endpoint",
        region_network_endpoint_group=group.name,
        region="us-central1",
        ip_address="8.8.8.8",
        port=443)
    
    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.NewNetwork(ctx, "default", &compute.NetworkArgs{
    			Name:                  pulumi.String("network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		group, err := compute.NewRegionNetworkEndpointGroup(ctx, "group", &compute.RegionNetworkEndpointGroupArgs{
    			Name:                pulumi.String("ip-port-neg"),
    			Network:             _default.ID(),
    			Region:              pulumi.String("us-central1"),
    			NetworkEndpointType: pulumi.String("INTERNET_IP_PORT"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRegionNetworkEndpoint(ctx, "region-internet-ip-port-endpoint", &compute.RegionNetworkEndpointArgs{
    			RegionNetworkEndpointGroup: group.Name,
    			Region:                     pulumi.String("us-central1"),
    			IpAddress:                  pulumi.String("8.8.8.8"),
    			Port:                       pulumi.Int(443),
    		})
    		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 @default = new Gcp.Compute.Network("default", new()
        {
            Name = "network",
            AutoCreateSubnetworks = false,
        });
    
        var @group = new Gcp.Compute.RegionNetworkEndpointGroup("group", new()
        {
            Name = "ip-port-neg",
            Network = @default.Id,
            Region = "us-central1",
            NetworkEndpointType = "INTERNET_IP_PORT",
        });
    
        var region_internet_ip_port_endpoint = new Gcp.Compute.RegionNetworkEndpoint("region-internet-ip-port-endpoint", new()
        {
            RegionNetworkEndpointGroup = @group.Name,
            Region = "us-central1",
            IpAddress = "8.8.8.8",
            Port = 443,
        });
    
    });
    
    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.RegionNetworkEndpointGroup;
    import com.pulumi.gcp.compute.RegionNetworkEndpointGroupArgs;
    import com.pulumi.gcp.compute.RegionNetworkEndpoint;
    import com.pulumi.gcp.compute.RegionNetworkEndpointArgs;
    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", NetworkArgs.builder()
                .name("network")
                .autoCreateSubnetworks(false)
                .build());
    
            var group = new RegionNetworkEndpointGroup("group", RegionNetworkEndpointGroupArgs.builder()
                .name("ip-port-neg")
                .network(default_.id())
                .region("us-central1")
                .networkEndpointType("INTERNET_IP_PORT")
                .build());
    
            var region_internet_ip_port_endpoint = new RegionNetworkEndpoint("region-internet-ip-port-endpoint", RegionNetworkEndpointArgs.builder()
                .regionNetworkEndpointGroup(group.name())
                .region("us-central1")
                .ipAddress("8.8.8.8")
                .port(443)
                .build());
    
        }
    }
    
    resources:
      region-internet-ip-port-endpoint:
        type: gcp:compute:RegionNetworkEndpoint
        properties:
          regionNetworkEndpointGroup: ${group.name}
          region: us-central1
          ipAddress: 8.8.8.8
          port: 443
      group:
        type: gcp:compute:RegionNetworkEndpointGroup
        properties:
          name: ip-port-neg
          network: ${default.id}
          region: us-central1
          networkEndpointType: INTERNET_IP_PORT
      default:
        type: gcp:compute:Network
        properties:
          name: network
          autoCreateSubnetworks: false
    

    Region Network Endpoint Internet Fqdn Port

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Network("default", {
        name: "network",
        autoCreateSubnetworks: false,
    });
    const group = new gcp.compute.RegionNetworkEndpointGroup("group", {
        name: "fqdn-port-neg",
        network: _default.id,
        region: "us-central1",
        networkEndpointType: "INTERNET_FQDN_PORT",
    });
    const region_internet_fqdn_port_endpoint = new gcp.compute.RegionNetworkEndpoint("region-internet-fqdn-port-endpoint", {
        regionNetworkEndpointGroup: group.name,
        region: "us-central1",
        fqdn: "backend.example.com",
        port: 443,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Network("default",
        name="network",
        auto_create_subnetworks=False)
    group = gcp.compute.RegionNetworkEndpointGroup("group",
        name="fqdn-port-neg",
        network=default.id,
        region="us-central1",
        network_endpoint_type="INTERNET_FQDN_PORT")
    region_internet_fqdn_port_endpoint = gcp.compute.RegionNetworkEndpoint("region-internet-fqdn-port-endpoint",
        region_network_endpoint_group=group.name,
        region="us-central1",
        fqdn="backend.example.com",
        port=443)
    
    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.NewNetwork(ctx, "default", &compute.NetworkArgs{
    			Name:                  pulumi.String("network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		group, err := compute.NewRegionNetworkEndpointGroup(ctx, "group", &compute.RegionNetworkEndpointGroupArgs{
    			Name:                pulumi.String("fqdn-port-neg"),
    			Network:             _default.ID(),
    			Region:              pulumi.String("us-central1"),
    			NetworkEndpointType: pulumi.String("INTERNET_FQDN_PORT"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRegionNetworkEndpoint(ctx, "region-internet-fqdn-port-endpoint", &compute.RegionNetworkEndpointArgs{
    			RegionNetworkEndpointGroup: group.Name,
    			Region:                     pulumi.String("us-central1"),
    			Fqdn:                       pulumi.String("backend.example.com"),
    			Port:                       pulumi.Int(443),
    		})
    		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 @default = new Gcp.Compute.Network("default", new()
        {
            Name = "network",
            AutoCreateSubnetworks = false,
        });
    
        var @group = new Gcp.Compute.RegionNetworkEndpointGroup("group", new()
        {
            Name = "fqdn-port-neg",
            Network = @default.Id,
            Region = "us-central1",
            NetworkEndpointType = "INTERNET_FQDN_PORT",
        });
    
        var region_internet_fqdn_port_endpoint = new Gcp.Compute.RegionNetworkEndpoint("region-internet-fqdn-port-endpoint", new()
        {
            RegionNetworkEndpointGroup = @group.Name,
            Region = "us-central1",
            Fqdn = "backend.example.com",
            Port = 443,
        });
    
    });
    
    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.RegionNetworkEndpointGroup;
    import com.pulumi.gcp.compute.RegionNetworkEndpointGroupArgs;
    import com.pulumi.gcp.compute.RegionNetworkEndpoint;
    import com.pulumi.gcp.compute.RegionNetworkEndpointArgs;
    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", NetworkArgs.builder()
                .name("network")
                .autoCreateSubnetworks(false)
                .build());
    
            var group = new RegionNetworkEndpointGroup("group", RegionNetworkEndpointGroupArgs.builder()
                .name("fqdn-port-neg")
                .network(default_.id())
                .region("us-central1")
                .networkEndpointType("INTERNET_FQDN_PORT")
                .build());
    
            var region_internet_fqdn_port_endpoint = new RegionNetworkEndpoint("region-internet-fqdn-port-endpoint", RegionNetworkEndpointArgs.builder()
                .regionNetworkEndpointGroup(group.name())
                .region("us-central1")
                .fqdn("backend.example.com")
                .port(443)
                .build());
    
        }
    }
    
    resources:
      region-internet-fqdn-port-endpoint:
        type: gcp:compute:RegionNetworkEndpoint
        properties:
          regionNetworkEndpointGroup: ${group.name}
          region: us-central1
          fqdn: backend.example.com
          port: 443
      group:
        type: gcp:compute:RegionNetworkEndpointGroup
        properties:
          name: fqdn-port-neg
          network: ${default.id}
          region: us-central1
          networkEndpointType: INTERNET_FQDN_PORT
      default:
        type: gcp:compute:Network
        properties:
          name: network
          autoCreateSubnetworks: false
    

    Region Network Endpoint Portmap

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.compute.Network("default", {
        name: "network",
        autoCreateSubnetworks: false,
    });
    const defaultSubnetwork = new gcp.compute.Subnetwork("default", {
        name: "subnetwork",
        ipCidrRange: "10.0.0.0/16",
        region: "us-central1",
        network: _default.id,
    });
    const defaultRegionNetworkEndpointGroup = new gcp.compute.RegionNetworkEndpointGroup("default", {
        name: "portmap-neg",
        region: "us-central1",
        network: _default.id,
        subnetwork: defaultSubnetwork.id,
        networkEndpointType: "GCE_VM_IP_PORTMAP",
    });
    const myImage = gcp.compute.getImage({
        family: "debian-11",
        project: "debian-cloud",
    });
    const defaultInstance = new gcp.compute.Instance("default", {
        networkInterfaces: [{
            accessConfigs: [{}],
            subnetwork: defaultSubnetwork.id,
        }],
        name: "instance",
        machineType: "e2-medium",
        zone: "us-central1-a",
        bootDisk: {
            initializeParams: {
                image: myImage.then(myImage => myImage.selfLink),
            },
        },
    });
    const regionNetworkEndpointPortmap = new gcp.compute.RegionNetworkEndpoint("region_network_endpoint_portmap", {
        regionNetworkEndpointGroup: defaultRegionNetworkEndpointGroup.name,
        region: "us-central1",
        instance: defaultInstance.selfLink,
        port: 80,
        ipAddress: defaultInstance.networkInterfaces.apply(networkInterfaces => networkInterfaces[0].networkIp),
        clientDestinationPort: 8080,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.compute.Network("default",
        name="network",
        auto_create_subnetworks=False)
    default_subnetwork = gcp.compute.Subnetwork("default",
        name="subnetwork",
        ip_cidr_range="10.0.0.0/16",
        region="us-central1",
        network=default.id)
    default_region_network_endpoint_group = gcp.compute.RegionNetworkEndpointGroup("default",
        name="portmap-neg",
        region="us-central1",
        network=default.id,
        subnetwork=default_subnetwork.id,
        network_endpoint_type="GCE_VM_IP_PORTMAP")
    my_image = gcp.compute.get_image(family="debian-11",
        project="debian-cloud")
    default_instance = gcp.compute.Instance("default",
        network_interfaces=[{
            "access_configs": [{}],
            "subnetwork": default_subnetwork.id,
        }],
        name="instance",
        machine_type="e2-medium",
        zone="us-central1-a",
        boot_disk={
            "initialize_params": {
                "image": my_image.self_link,
            },
        })
    region_network_endpoint_portmap = gcp.compute.RegionNetworkEndpoint("region_network_endpoint_portmap",
        region_network_endpoint_group=default_region_network_endpoint_group.name,
        region="us-central1",
        instance=default_instance.self_link,
        port=80,
        ip_address=default_instance.network_interfaces[0].network_ip,
        client_destination_port=8080)
    
    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.NewNetwork(ctx, "default", &compute.NetworkArgs{
    			Name:                  pulumi.String("network"),
    			AutoCreateSubnetworks: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSubnetwork, err := compute.NewSubnetwork(ctx, "default", &compute.SubnetworkArgs{
    			Name:        pulumi.String("subnetwork"),
    			IpCidrRange: pulumi.String("10.0.0.0/16"),
    			Region:      pulumi.String("us-central1"),
    			Network:     _default.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultRegionNetworkEndpointGroup, err := compute.NewRegionNetworkEndpointGroup(ctx, "default", &compute.RegionNetworkEndpointGroupArgs{
    			Name:                pulumi.String("portmap-neg"),
    			Region:              pulumi.String("us-central1"),
    			Network:             _default.ID(),
    			Subnetwork:          defaultSubnetwork.ID(),
    			NetworkEndpointType: pulumi.String("GCE_VM_IP_PORTMAP"),
    		})
    		if err != nil {
    			return err
    		}
    		myImage, err := compute.LookupImage(ctx, &compute.LookupImageArgs{
    			Family:  pulumi.StringRef("debian-11"),
    			Project: pulumi.StringRef("debian-cloud"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultInstance, err := compute.NewInstance(ctx, "default", &compute.InstanceArgs{
    			NetworkInterfaces: compute.InstanceNetworkInterfaceArray{
    				&compute.InstanceNetworkInterfaceArgs{
    					AccessConfigs: compute.InstanceNetworkInterfaceAccessConfigArray{
    						&compute.InstanceNetworkInterfaceAccessConfigArgs{},
    					},
    					Subnetwork: defaultSubnetwork.ID(),
    				},
    			},
    			Name:        pulumi.String("instance"),
    			MachineType: pulumi.String("e2-medium"),
    			Zone:        pulumi.String("us-central1-a"),
    			BootDisk: &compute.InstanceBootDiskArgs{
    				InitializeParams: &compute.InstanceBootDiskInitializeParamsArgs{
    					Image: pulumi.String(myImage.SelfLink),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewRegionNetworkEndpoint(ctx, "region_network_endpoint_portmap", &compute.RegionNetworkEndpointArgs{
    			RegionNetworkEndpointGroup: defaultRegionNetworkEndpointGroup.Name,
    			Region:                     pulumi.String("us-central1"),
    			Instance:                   defaultInstance.SelfLink,
    			Port:                       pulumi.Int(80),
    			IpAddress: pulumi.String(defaultInstance.NetworkInterfaces.ApplyT(func(networkInterfaces []compute.InstanceNetworkInterface) (*string, error) {
    				return &networkInterfaces[0].NetworkIp, nil
    			}).(pulumi.StringPtrOutput)),
    			ClientDestinationPort: pulumi.Int(8080),
    		})
    		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 @default = new Gcp.Compute.Network("default", new()
        {
            Name = "network",
            AutoCreateSubnetworks = false,
        });
    
        var defaultSubnetwork = new Gcp.Compute.Subnetwork("default", new()
        {
            Name = "subnetwork",
            IpCidrRange = "10.0.0.0/16",
            Region = "us-central1",
            Network = @default.Id,
        });
    
        var defaultRegionNetworkEndpointGroup = new Gcp.Compute.RegionNetworkEndpointGroup("default", new()
        {
            Name = "portmap-neg",
            Region = "us-central1",
            Network = @default.Id,
            Subnetwork = defaultSubnetwork.Id,
            NetworkEndpointType = "GCE_VM_IP_PORTMAP",
        });
    
        var myImage = Gcp.Compute.GetImage.Invoke(new()
        {
            Family = "debian-11",
            Project = "debian-cloud",
        });
    
        var defaultInstance = new Gcp.Compute.Instance("default", new()
        {
            NetworkInterfaces = new[]
            {
                new Gcp.Compute.Inputs.InstanceNetworkInterfaceArgs
                {
                    AccessConfigs = new[]
                    {
                        null,
                    },
                    Subnetwork = defaultSubnetwork.Id,
                },
            },
            Name = "instance",
            MachineType = "e2-medium",
            Zone = "us-central1-a",
            BootDisk = new Gcp.Compute.Inputs.InstanceBootDiskArgs
            {
                InitializeParams = new Gcp.Compute.Inputs.InstanceBootDiskInitializeParamsArgs
                {
                    Image = myImage.Apply(getImageResult => getImageResult.SelfLink),
                },
            },
        });
    
        var regionNetworkEndpointPortmap = new Gcp.Compute.RegionNetworkEndpoint("region_network_endpoint_portmap", new()
        {
            RegionNetworkEndpointGroup = defaultRegionNetworkEndpointGroup.Name,
            Region = "us-central1",
            Instance = defaultInstance.SelfLink,
            Port = 80,
            IpAddress = defaultInstance.NetworkInterfaces.Apply(networkInterfaces => networkInterfaces[0].NetworkIp),
            ClientDestinationPort = 8080,
        });
    
    });
    
    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.RegionNetworkEndpointGroup;
    import com.pulumi.gcp.compute.RegionNetworkEndpointGroupArgs;
    import com.pulumi.gcp.compute.ComputeFunctions;
    import com.pulumi.gcp.compute.inputs.GetImageArgs;
    import com.pulumi.gcp.compute.Instance;
    import com.pulumi.gcp.compute.InstanceArgs;
    import com.pulumi.gcp.compute.inputs.InstanceNetworkInterfaceArgs;
    import com.pulumi.gcp.compute.inputs.InstanceBootDiskArgs;
    import com.pulumi.gcp.compute.inputs.InstanceBootDiskInitializeParamsArgs;
    import com.pulumi.gcp.compute.RegionNetworkEndpoint;
    import com.pulumi.gcp.compute.RegionNetworkEndpointArgs;
    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", NetworkArgs.builder()
                .name("network")
                .autoCreateSubnetworks(false)
                .build());
    
            var defaultSubnetwork = new Subnetwork("defaultSubnetwork", SubnetworkArgs.builder()
                .name("subnetwork")
                .ipCidrRange("10.0.0.0/16")
                .region("us-central1")
                .network(default_.id())
                .build());
    
            var defaultRegionNetworkEndpointGroup = new RegionNetworkEndpointGroup("defaultRegionNetworkEndpointGroup", RegionNetworkEndpointGroupArgs.builder()
                .name("portmap-neg")
                .region("us-central1")
                .network(default_.id())
                .subnetwork(defaultSubnetwork.id())
                .networkEndpointType("GCE_VM_IP_PORTMAP")
                .build());
    
            final var myImage = ComputeFunctions.getImage(GetImageArgs.builder()
                .family("debian-11")
                .project("debian-cloud")
                .build());
    
            var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
                .networkInterfaces(InstanceNetworkInterfaceArgs.builder()
                    .accessConfigs()
                    .subnetwork(defaultSubnetwork.id())
                    .build())
                .name("instance")
                .machineType("e2-medium")
                .zone("us-central1-a")
                .bootDisk(InstanceBootDiskArgs.builder()
                    .initializeParams(InstanceBootDiskInitializeParamsArgs.builder()
                        .image(myImage.applyValue(getImageResult -> getImageResult.selfLink()))
                        .build())
                    .build())
                .build());
    
            var regionNetworkEndpointPortmap = new RegionNetworkEndpoint("regionNetworkEndpointPortmap", RegionNetworkEndpointArgs.builder()
                .regionNetworkEndpointGroup(defaultRegionNetworkEndpointGroup.name())
                .region("us-central1")
                .instance(defaultInstance.selfLink())
                .port(80)
                .ipAddress(defaultInstance.networkInterfaces().applyValue(networkInterfaces -> networkInterfaces[0].networkIp()))
                .clientDestinationPort(8080)
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:compute:Network
        properties:
          name: network
          autoCreateSubnetworks: false
      defaultSubnetwork:
        type: gcp:compute:Subnetwork
        name: default
        properties:
          name: subnetwork
          ipCidrRange: 10.0.0.0/16
          region: us-central1
          network: ${default.id}
      defaultRegionNetworkEndpointGroup:
        type: gcp:compute:RegionNetworkEndpointGroup
        name: default
        properties:
          name: portmap-neg
          region: us-central1
          network: ${default.id}
          subnetwork: ${defaultSubnetwork.id}
          networkEndpointType: GCE_VM_IP_PORTMAP
      regionNetworkEndpointPortmap:
        type: gcp:compute:RegionNetworkEndpoint
        name: region_network_endpoint_portmap
        properties:
          regionNetworkEndpointGroup: ${defaultRegionNetworkEndpointGroup.name}
          region: us-central1
          instance: ${defaultInstance.selfLink}
          port: 80
          ipAddress: ${defaultInstance.networkInterfaces[0].networkIp}
          clientDestinationPort: 8080
      defaultInstance:
        type: gcp:compute:Instance
        name: default
        properties:
          networkInterfaces:
            - accessConfigs:
                - {}
              subnetwork: ${defaultSubnetwork.id}
          name: instance
          machineType: e2-medium
          zone: us-central1-a
          bootDisk:
            initializeParams:
              image: ${myImage.selfLink}
    variables:
      myImage:
        fn::invoke:
          Function: gcp:compute:getImage
          Arguments:
            family: debian-11
            project: debian-cloud
    

    Create RegionNetworkEndpoint Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RegionNetworkEndpoint(name: string, args: RegionNetworkEndpointArgs, opts?: CustomResourceOptions);
    @overload
    def RegionNetworkEndpoint(resource_name: str,
                              args: RegionNetworkEndpointArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def RegionNetworkEndpoint(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              port: Optional[int] = None,
                              region_network_endpoint_group: Optional[str] = None,
                              client_destination_port: Optional[int] = None,
                              fqdn: Optional[str] = None,
                              instance: Optional[str] = None,
                              ip_address: Optional[str] = None,
                              project: Optional[str] = None,
                              region: Optional[str] = None)
    func NewRegionNetworkEndpoint(ctx *Context, name string, args RegionNetworkEndpointArgs, opts ...ResourceOption) (*RegionNetworkEndpoint, error)
    public RegionNetworkEndpoint(string name, RegionNetworkEndpointArgs args, CustomResourceOptions? opts = null)
    public RegionNetworkEndpoint(String name, RegionNetworkEndpointArgs args)
    public RegionNetworkEndpoint(String name, RegionNetworkEndpointArgs args, CustomResourceOptions options)
    
    type: gcp:compute:RegionNetworkEndpoint
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args RegionNetworkEndpointArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RegionNetworkEndpointArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RegionNetworkEndpointArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RegionNetworkEndpointArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RegionNetworkEndpointArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var regionNetworkEndpointResource = new Gcp.Compute.RegionNetworkEndpoint("regionNetworkEndpointResource", new()
    {
        Port = 0,
        RegionNetworkEndpointGroup = "string",
        ClientDestinationPort = 0,
        Fqdn = "string",
        Instance = "string",
        IpAddress = "string",
        Project = "string",
        Region = "string",
    });
    
    example, err := compute.NewRegionNetworkEndpoint(ctx, "regionNetworkEndpointResource", &compute.RegionNetworkEndpointArgs{
    	Port:                       pulumi.Int(0),
    	RegionNetworkEndpointGroup: pulumi.String("string"),
    	ClientDestinationPort:      pulumi.Int(0),
    	Fqdn:                       pulumi.String("string"),
    	Instance:                   pulumi.String("string"),
    	IpAddress:                  pulumi.String("string"),
    	Project:                    pulumi.String("string"),
    	Region:                     pulumi.String("string"),
    })
    
    var regionNetworkEndpointResource = new RegionNetworkEndpoint("regionNetworkEndpointResource", RegionNetworkEndpointArgs.builder()
        .port(0)
        .regionNetworkEndpointGroup("string")
        .clientDestinationPort(0)
        .fqdn("string")
        .instance("string")
        .ipAddress("string")
        .project("string")
        .region("string")
        .build());
    
    region_network_endpoint_resource = gcp.compute.RegionNetworkEndpoint("regionNetworkEndpointResource",
        port=0,
        region_network_endpoint_group="string",
        client_destination_port=0,
        fqdn="string",
        instance="string",
        ip_address="string",
        project="string",
        region="string")
    
    const regionNetworkEndpointResource = new gcp.compute.RegionNetworkEndpoint("regionNetworkEndpointResource", {
        port: 0,
        regionNetworkEndpointGroup: "string",
        clientDestinationPort: 0,
        fqdn: "string",
        instance: "string",
        ipAddress: "string",
        project: "string",
        region: "string",
    });
    
    type: gcp:compute:RegionNetworkEndpoint
    properties:
        clientDestinationPort: 0
        fqdn: string
        instance: string
        ipAddress: string
        port: 0
        project: string
        region: string
        regionNetworkEndpointGroup: string
    

    RegionNetworkEndpoint Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The RegionNetworkEndpoint resource accepts the following input properties:

    Port int
    Port number of network endpoint.
    RegionNetworkEndpointGroup string
    The network endpoint group this endpoint is part of.


    ClientDestinationPort int
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    Fqdn string
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    Instance string
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    IpAddress string
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the containing network endpoint group is located.
    Port int
    Port number of network endpoint.
    RegionNetworkEndpointGroup string
    The network endpoint group this endpoint is part of.


    ClientDestinationPort int
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    Fqdn string
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    Instance string
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    IpAddress string
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the containing network endpoint group is located.
    port Integer
    Port number of network endpoint.
    regionNetworkEndpointGroup String
    The network endpoint group this endpoint is part of.


    clientDestinationPort Integer
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn String
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance String
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ipAddress String
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the containing network endpoint group is located.
    port number
    Port number of network endpoint.
    regionNetworkEndpointGroup string
    The network endpoint group this endpoint is part of.


    clientDestinationPort number
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn string
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance string
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ipAddress string
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    Region where the containing network endpoint group is located.
    port int
    Port number of network endpoint.
    region_network_endpoint_group str
    The network endpoint group this endpoint is part of.


    client_destination_port int
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn str
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance str
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ip_address str
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    Region where the containing network endpoint group is located.
    port Number
    Port number of network endpoint.
    regionNetworkEndpointGroup String
    The network endpoint group this endpoint is part of.


    clientDestinationPort Number
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn String
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance String
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ipAddress String
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the containing network endpoint group is located.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RegionNetworkEndpoint resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RegionNetworkEndpoint Resource

    Get an existing RegionNetworkEndpoint resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RegionNetworkEndpointState, opts?: CustomResourceOptions): RegionNetworkEndpoint
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            client_destination_port: Optional[int] = None,
            fqdn: Optional[str] = None,
            instance: Optional[str] = None,
            ip_address: Optional[str] = None,
            port: Optional[int] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            region_network_endpoint_group: Optional[str] = None) -> RegionNetworkEndpoint
    func GetRegionNetworkEndpoint(ctx *Context, name string, id IDInput, state *RegionNetworkEndpointState, opts ...ResourceOption) (*RegionNetworkEndpoint, error)
    public static RegionNetworkEndpoint Get(string name, Input<string> id, RegionNetworkEndpointState? state, CustomResourceOptions? opts = null)
    public static RegionNetworkEndpoint get(String name, Output<String> id, RegionNetworkEndpointState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ClientDestinationPort int
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    Fqdn string
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    Instance string
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    IpAddress string
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    Port int
    Port number of network endpoint.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the containing network endpoint group is located.
    RegionNetworkEndpointGroup string
    The network endpoint group this endpoint is part of.


    ClientDestinationPort int
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    Fqdn string
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    Instance string
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    IpAddress string
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    Port int
    Port number of network endpoint.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    Region where the containing network endpoint group is located.
    RegionNetworkEndpointGroup string
    The network endpoint group this endpoint is part of.


    clientDestinationPort Integer
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn String
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance String
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ipAddress String
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    port Integer
    Port number of network endpoint.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the containing network endpoint group is located.
    regionNetworkEndpointGroup String
    The network endpoint group this endpoint is part of.


    clientDestinationPort number
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn string
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance string
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ipAddress string
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    port number
    Port number of network endpoint.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    Region where the containing network endpoint group is located.
    regionNetworkEndpointGroup string
    The network endpoint group this endpoint is part of.


    client_destination_port int
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn str
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance str
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ip_address str
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    port int
    Port number of network endpoint.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    Region where the containing network endpoint group is located.
    region_network_endpoint_group str
    The network endpoint group this endpoint is part of.


    clientDestinationPort Number
    Client destination port for the GCE_VM_IP_PORTMAP NEG.
    fqdn String
    Fully qualified domain name of network endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
    instance String
    The name for a specific VM instance that the IP address belongs to. This is required for network endpoints of type GCE_VM_IP_PORTMAP.
    ipAddress String
    IPv4 address external endpoint. This can only be specified when network_endpoint_type of the NEG is INTERNET_IP_PORT.
    port Number
    Port number of network endpoint.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    Region where the containing network endpoint group is located.
    regionNetworkEndpointGroup String
    The network endpoint group this endpoint is part of.


    Import

    RegionNetworkEndpoint can be imported using any of these accepted formats:

    • projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}

    • {{project}}/{{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}

    • {{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}

    • {{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}

    When using the pulumi import command, RegionNetworkEndpoint can be imported using one of the formats above. For example:

    $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
    
    $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default {{project}}/{{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
    
    $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default {{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
    
    $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default {{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    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 v8.9.3 published on Monday, Nov 18, 2024 by Pulumi