I am trying to configure a fallback to my Apigee proxy target definition, but the health checks only return 403. The target is a Cloud Run that requires authentication (done via GoogleIDToken), and exposes a /health endpoint.
Here’s what I see in the Cloud Run logs:“The request was not authenticated. Either allow unauthenticated invocations or set the proper Authorization header. Read more at Authentication overview | Cloud Run Documentation | Google Cloud Additional troubleshooting documentation can be found at: Troubleshoot Cloud Run issues | Cloud Run Documentation | Google Cloud
For monitoring purposes, I added /health as an endpoint in my proxy, and I can successfully call it from Postman. But when Apigee tries to call it as part of the HealthMonitor configuration in the target definition, it gets a 403 back.
Here’s the definition of the target:
<TargetEndpoint name="default">
<HTTPTargetConnection>
<LoadBalancer>
<Algorithm>RoundRobin</Algorithm>
<Server name="server1" />
<Server name="server2">
<IsFallback>true</IsFallback>
</Server>
<MaxFailures>5</MaxFailures>
<ServerUnhealthyResponse>
<ResponseCode>500</ResponseCode>
<ResponseCode>502</ResponseCode>
<ResponseCode>503</ResponseCode>
</ServerUnhealthyResponse>
</LoadBalancer>
<HealthMonitor>
<IsEnabled>true</IsEnabled>
<IntervalInSec>5</IntervalInSec>
<HTTPMonitor>
<Request>
<UseTargetServerSSLInfo>true</UseTargetServerSSLInfo>
<ConnectTimeoutInSec>10</ConnectTimeoutInSec>
<SocketReadTimeoutInSec>30</SocketReadTimeoutInSec>
<Port>443</Port>
<Verb>GET</Verb>
<Path>/health</Path>
<IsSSL>true</IsSSL>
</Request>
<SuccessResponse>
<ResponseCode>200</ResponseCode>
</SuccessResponse>
</HTTPMonitor>
</HealthMonitor>
<Authentication>
<GoogleIDToken>
<Audience useTargetUrl="true"/>
</GoogleIDToken>
</Authentication>
</HTTPTargetConnection>
</TargetEndpoint>
So it seems the GoogleIDToken is not being applied to the health check (whereas it is used in my /health endpoint calls and thus works).
What could be the issue? Am I overconfiguring the HealthMonitor? In the example and other posts here I saw it defined without IsSSL and UseTargetServerSSLInfo. I also did not include the Basic Authorization header mentioned in the documentation.
Gemini suggested adding the tag “IncludeInHealthCheck“ inside the GoogleIDToken tag, but I think it is hallucinating, as I did not find a mention of that anywhere else.
Guidance is much appreciated