UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

295 lines (294 loc) • 11.1 kB
import * as pulumi from "@pulumi/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: * * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/regionNetworkEndpointGroups) * * How-to Guides * * [Internet NEGs Official Documentation](https://cloud.google.com/load-balancing/docs/negs/internet-neg-concepts) * * [Official Documentation](https://cloud.google.com/load-balancing/docs/negs/) * * ## Example Usage * * ### Region Network Endpoint Internet Ip Port * * ```typescript * 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, * }); * ``` * ### Region Network Endpoint Internet Fqdn Port * * ```typescript * 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, * }); * ``` * ### Region Network Endpoint Portmap * * ```typescript * 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 * * 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: * * ```sh * $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default projects/{{project}}/regions/{{region}}/networkEndpointGroups/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} * ``` * * ```sh * $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default {{project}}/{{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} * ``` * * ```sh * $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default {{region}}/{{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} * ``` * * ```sh * $ pulumi import gcp:compute/regionNetworkEndpoint:RegionNetworkEndpoint default {{region_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}} * ``` */ export declare class RegionNetworkEndpoint extends pulumi.CustomResource { /** * Get an existing RegionNetworkEndpoint resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RegionNetworkEndpointState, opts?: pulumi.CustomResourceOptions): RegionNetworkEndpoint; /** * Returns true if the given object is an instance of RegionNetworkEndpoint. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is RegionNetworkEndpoint; /** * Client destination port for the `GCE_VM_IP_PORTMAP` NEG. */ readonly clientDestinationPort: pulumi.Output<number | undefined>; /** * Fully qualified domain name of network endpoint. * This can only be specified when networkEndpointType of the NEG is INTERNET_FQDN_PORT. */ readonly fqdn: pulumi.Output<string | undefined>; /** * 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. */ readonly instance: pulumi.Output<string | undefined>; /** * IPv4 address external endpoint. * This can only be specified when networkEndpointType of the NEG is INTERNET_IP_PORT. */ readonly ipAddress: pulumi.Output<string | undefined>; /** * The unique identifier number for the resource. This identifier is defined by the server. */ readonly networkEndpointId: pulumi.Output<number>; /** * Port number of network endpoint. */ readonly port: pulumi.Output<number>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Region where the containing network endpoint group is located. */ readonly region: pulumi.Output<string>; /** * The network endpoint group this endpoint is part of. */ readonly regionNetworkEndpointGroup: pulumi.Output<string>; /** * Create a RegionNetworkEndpoint resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RegionNetworkEndpointArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RegionNetworkEndpoint resources. */ export interface RegionNetworkEndpointState { /** * Client destination port for the `GCE_VM_IP_PORTMAP` NEG. */ clientDestinationPort?: pulumi.Input<number>; /** * Fully qualified domain name of network endpoint. * This can only be specified when networkEndpointType of the NEG is INTERNET_FQDN_PORT. */ fqdn?: pulumi.Input<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. */ instance?: pulumi.Input<string>; /** * IPv4 address external endpoint. * This can only be specified when networkEndpointType of the NEG is INTERNET_IP_PORT. */ ipAddress?: pulumi.Input<string>; /** * The unique identifier number for the resource. This identifier is defined by the server. */ networkEndpointId?: pulumi.Input<number>; /** * Port number of network endpoint. */ port?: pulumi.Input<number>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Region where the containing network endpoint group is located. */ region?: pulumi.Input<string>; /** * The network endpoint group this endpoint is part of. */ regionNetworkEndpointGroup?: pulumi.Input<string>; } /** * The set of arguments for constructing a RegionNetworkEndpoint resource. */ export interface RegionNetworkEndpointArgs { /** * Client destination port for the `GCE_VM_IP_PORTMAP` NEG. */ clientDestinationPort?: pulumi.Input<number>; /** * Fully qualified domain name of network endpoint. * This can only be specified when networkEndpointType of the NEG is INTERNET_FQDN_PORT. */ fqdn?: pulumi.Input<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. */ instance?: pulumi.Input<string>; /** * IPv4 address external endpoint. * This can only be specified when networkEndpointType of the NEG is INTERNET_IP_PORT. */ ipAddress?: pulumi.Input<string>; /** * Port number of network endpoint. */ port: pulumi.Input<number>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * Region where the containing network endpoint group is located. */ region?: pulumi.Input<string>; /** * The network endpoint group this endpoint is part of. */ regionNetworkEndpointGroup: pulumi.Input<string>; }