1

I am calling an external service from my cloud function that only allows requests from whitelisted IP addresses.

In such case I've followed the following steps mentioned in article https://cloud.google.com/functions/docs/networking/network-settings#associate-static-ip

But when I am executing the cloud function the external service receiving the call from IP 0.0.0.0(which I can see default internet gateway) instead of my reserved static IP.

Can you please guide me the steps if I missed anything.

Sougata
  • 97
  • 1
  • 7
  • 1
    It is possible, but you need to use a VPC connector for your cloud functions, this connector allows your functions to reach the IP addresses in your project. After deploying your VPC connector your cloud functions can reach a virtual machine that would act as an outbound traffic proxy for your cloud functions, virtual machines can be configured to use a public static IP, this might be a good approach, but more expensive and complicated than move your function to a virtual machine https://cloud.google.com/functions/docs/networking/connecting-vpc – Jan Hernandez Jun 19 '20 at 22:16
  • 've setup cloud NAT properly also internet connection has been established in clod function. but I found it always taking 0.0.0.0 as internet broadcast IP \, not the static IP which I've patched on cloud Nat. Can you help me to fix it. – Sougata Jun 21 '20 at 04:00
  • What do you mean my new http calls ? My cloud function implementation call an external API endpoint. so when I trigger cloud function it always hits that API endpoint. But it always did with brodcast IP 0.0.0.0 instead of cloud NAT public IP – Sougata Jun 21 '20 at 06:24

0 Answers0