question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Internet NEG backends must not have a health check

See original GitHub issue

Pulumi attempts to enforce the healthChecks field on the compute.BackendService resource but this field must not be passed to the GCP API in certain circumstances.

// The following infrastructure is used so that we can use Cloud CDN with Cloud Functions.
const cloudFunctionsNEG = new gcp.compute.GlobalNetworkEndpointGroup(
  'cloud-functions',
  {
    networkEndpointType: 'INTERNET_FQDN_PORT',
  },
  { provider: gcpProvider },
)
const cloudFunctionsNE = new gcp.compute.GlobalNetworkEndpoint(
  'cloud-functions',
  {
    globalNetworkEndpointGroup: cloudFunctionsNEG.name,
    fqdn: `us-central1-${project}.cloudfunctions.net`,
    port: 443, // HTTPS
  },
  { provider: gcpProvider },
)
const cloudFunctionsBS = new gcp.compute.BackendService(
  'cloud-functions',
  // @ts-expect-error: `healthChecks` is required by Pulumi but backend services with
  // internet NEG backends must not have a health check according to GCP docs.
  //
  // See https://cloud.google.com/compute/docs/reference/rest/v1/backendServices
  {
    backends: [{ group: cloudFunctionsNEG.id }],
    enableCdn: true,
    protocol: 'HTTPS',
  },
  { provider: gcpProvider },
)

Unfortunately the @ts-expect-error directive doesn’t help here since the SDK checks the field at runtime.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lmakarovcommented, Oct 2, 2020

Never mind. Figured out the issue. I was mistakenly using gcp.compute.NetworkEndpointGroup instead of gcp.compute.GlobalNetworkEndpointGroup.

The following works as expeceted:

const webNEG = new gcp.compute.GlobalNetworkEndpointGroup("web-neg", {
  networkEndpointType: "INTERNET_FQDN_PORT",
});

const webService = new gcp.compute.BackendService("web-service", {
  protocol: "HTTPS",
  backends: [
      {
        group: webNEG.selfLink,
      },
  ],
});

1reaction
leezencommented, Jun 30, 2020

Looks like this is tracked upstream in https://github.com/terraform-google-modules/terraform-google-lb-http/issues/105 and once that’s fixed should get picked up with the next pulumi-gcp update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Internet network endpoint groups overview | Load Balancing
A backend service with an internet NEG doesn't support a health check. Google Cloud doesn't provide health checking for any external backend.
Read more >
Make `health_check` optional to support internet/global NEG ...
The requirement that a group have a health check is a blocker. ... Internet NEG backends must not have a health check pulumi/pulumi-gcp#380....
Read more >
How to troubleshoot unhealthy backends in Google Cloud ...
Check out this video to learn the concepts - unhealthy backend, health checks and its importance, criteria for load balancer marking the ...
Read more >
Troubleshoot your Network Load Balancer
The HTTP host header in the health check request contains the IP address of the load balancer node and the listener port, not...
Read more >
NEGs with Load Balancer on GKE - Gabriel Hodoroaga
In this tutorial I will show you how to expose you application to the internet using the Cloud Load Balancing and NEGs (Network...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found