Julio Porto
Julio Porto

Reputation: 128

Is it possible route the traffic from an internal static IP to a cloud function/cloud run in GCP?

I'm trying to connect my app deployed in GCP cloud functions to on premises service through a VPN Tunnel. The problem is that the on premises VPN Tunnel config only accept ONE local static IP on my side of the tunnel and not a range of internal ips.

I could achieve this deploying a VM Instance with an static internal IP but but I want to keep the advantages of a cloud function/cloud run environment.

Is there any way to route the traffic from my internal static IP like 10.160.11.75 to a cloud function/cloud run service?

Upvotes: 0

Views: 784

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 76000

If you want to access On Prem resource through VPN and private IP in egress (I mean from your Cloud Functions to your On Prem) you must set up a VPC Connector on your service.

If it's in ingress mode, from your On Prem to your Cloud FUnctions, your VPN connection must land in the project of your Cloud Functions. You can even set the ingress of the cloud function to Internal to be sure that the Cloud Functions in only accessed from the VPC

Note: I think in preview the shared VPC also work. So, if you use a shared VPC with your Cloud Functions project and your VPN project, it will also work.

Upvotes: 1

Related Questions