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.

3
  • 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 cloud.google.com/functions/docs/networking/connecting-vpc Commented Jun 19, 2020 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. Commented Jun 21, 2020 at 4: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 Commented Jun 21, 2020 at 6:24

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.