Priya
Priya

Reputation: 45

Google Cloud Run - Services to discover other Internal services running within the same project

The requirement is to call other microservices running within the same GCP project using the service name instead of the full service url to get the ID token as mentioned here https://cloud.google.com/run/docs/authenticating/service-to-service.

I see a similar stackoverflow question - Google Cloud Run API - accessing endpoint internally. Here it looked like there was no direct solution from GCP and has been suggested to use runsd - https://github.com/ahmetb/runsd.

Is there something available from GCP now where a cloud run service can call another private cloud run service within the same project using "https://servicename" internally (or) Is it still not available and we need to use the complete service url https://--.run.app to get the ID Token and then make the call using the ID Token and the full service url?

I have tried using the full service url and ID Token to make the call. But getting the full url with the projectHash is not something we are looking for. A more uniform approach using the service name for internal call will be more easier from microservice calling perspective.

Upvotes: 1

Views: 364

Answers (2)

Chanpols
Chanpols

Reputation: 1712

Since Google Cloud is not offering this yet. You may file a feature request to this link. However, please keep in mind that this will still be under consideration and there is no definite ETA.

You must use the whole service URL, which contains the service name, project hash, and region, together with the ID token, to perform a service-to-service call to another Cloud Run service inside the same project.

Upvotes: 0

Priya
Priya

Reputation: 45

The above answer from Christian Paul Andaya is the accepted answer.

Upvotes: 1

Related Questions