How to access service over vpn gateway in google cloud function

1.2k views Asked by At

I have a scenario in which some HTTP service is deployed on AWS instance and I want to access this privately in my Google cloud function. What I have tested so far that using a VPN Gateway I can connect both google and AWS compute instance. BUT now I am looking for how it can be possible while using Google functions which are not under any VPC to access the service over VPN gateway. Is there any way I can assign my google cloud function to the VPC through which I can call AWS service over VPN Gateway?

1

There are 1 answers

0
guillaume blaquiere On

You can create a serverless VPC Connector in the Google CLoud VPC that you want and add it to your function.

On your function configuration, you can choose to route only the private IP through this connector, or all the requests initiated by the Cloud Functions.

So, if your route are correct, it should work!