1

Is it possible to during the backend service (https) creation attach it to a http health-check?

I'm asking that because if I try that manually (google cloud web console), I'm able to do it.

My script is the following:

gcloud compute http-health-checks create my-health-check --port 80 \
--host <my host goes here> \
--project "$PROJECT"`enter code here`

gcloud compute backend-services create my-bs \
--http-health-checks my-health-check \
--protocol HTTPS \
--timeout 5m \
--project "$PROJECT" \
--global

And I get the following error:

This HTTPS/HTTP2 backend service supports HealthCheck and HttpsHealthCheck

But if I create manually it the google (web console) allows me.

thiago
  • 123
  • 1
  • 3
  • 10
  • This can happen you create a backend with `protocol HTTPS` but you try to attach an `http-health-check`. You need to either create a `health-check` (as you did below) or create an `https-health-check`. – jwadsack Oct 11 '18 at 23:32

1 Answers1

1

I found the solution:

gcloud compute health-checks create http my-health-check --port 80 --host my-url --project "$PROJECT" 

gcloud compute backend-services create bs --health-checks my-health-check --protocol HTTPS --timeout 5m --project "$PROJECT" --global 
thiago
  • 123
  • 1
  • 3
  • 10