Eitan Nargassi
Eitan Nargassi

Reputation: 68

Google Cloud Run Internal DNS/IP for communication with same region VM

My app has two APIs - one hosted on Google Cloud Run, and the second on a VM instance. The general architecture is like this:

 ---------------        -----------------        ------------------
| Client Request| ---> | First API (VM)  | ---> | Second API (Run) |
 ---------------        -----------------        ------------------

When the VM sends a request to the second API, I want to use an internal IP/DNS in order to save networking egress costs. However, I can't find any documentations regarding how to do that. Maybe it's not possible, if so it's also find but I would just like to know.

Thank you very much!

Upvotes: 0

Views: 1807

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75715

For now, you can't call Cloud Run uniquely from the VPC. You have to use the public DNS of Cloud RUN

However, if your compute engine and your Cloud Run instance are in the same region, you won't pay egress traffic (traffic in the same region is free).

The Google internal router are smart enough to not route your traffic to internet for going back into the Google Network, and especially in the same region. In addition, and thanks to this smart routing, the latency will be very low.

Note: even if you use the project VPC and you have to call a Cloud Run in another region, you will pay egress (inter region traffic). Using internal IP/DNS only increase the security (not publicly accessible) but have no impact on the cost or the latency

Upvotes: 2

Related Questions