pulumi_wasm_providers_gcp_mini::compute

Module network_endpoint

source
Expand description

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.

NOTE In case the Endpoint’s Instance is recreated, it’s needed to perform apply twice. To avoid situations like this, please use this resource with the lifecycle replace_triggered_by method, with the passed Instance’s ID.

To get more information about NetworkEndpoint, see:

§Example Usage

§Network Endpoint

resources:
  default-endpoint:
    type: gcp:compute:NetworkEndpoint
    properties:
      networkEndpointGroup: ${neg.name}
      instance: ${["endpoint-instance"].name}
      port: ${neg.defaultPort}
      ipAddress: ${["endpoint-instance"].networkInterfaces[0].networkIp}
  endpoint-instance:
    type: gcp:compute:Instance
    properties:
      networkInterfaces:
        - accessConfigs:
            - {}
          subnetwork: ${defaultSubnetwork.id}
      name: endpoint-instance
      machineType: e2-medium
      bootDisk:
        initializeParams:
          image: ${myImage.selfLink}
  group:
    type: gcp:compute:NetworkEndpointGroup
    properties:
      name: my-lb-neg
      network: ${default.id}
      subnetwork: ${defaultSubnetwork.id}
      defaultPort: '90'
      zone: us-central1-a
  default:
    type: gcp:compute:Network
    properties:
      name: neg-network
      autoCreateSubnetworks: false
  defaultSubnetwork:
    type: gcp:compute:Subnetwork
    name: default
    properties:
      name: neg-subnetwork
      ipCidrRange: 10.0.0.1/16
      region: us-central1
      network: ${default.id}
variables:
  myImage:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-11
        project: debian-cloud

§Import

NetworkEndpoint can be imported using any of these accepted formats:

  • projects/{{project}}/zones/{{zone}}/networkEndpointGroups/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}

  • {{project}}/{{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}

  • {{zone}}/{{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}

  • {{network_endpoint_group}}/{{instance}}/{{ip_address}}/{{port}}

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

$ 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}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments