0

The title pretty much says it all, but the overall case is:

Third party API provider needs the IP address the request originates from in the request body.

I'm aware that we're able to get the IP address on Compute Engine instances using metadata server, but ideally we would like to use Cloud functions / Cloud run (Fully managed) for the use case. Are there any possibilities to access current instance IP address during runtime?

KKaar
  • 225
  • 1
  • 2
  • 10
  • For external use, you should not count on an IP address, as each endpoint is not assigned a dedicated IP. You can only use the URL that you've been given during deployment to determine how to invoke it. – Doug Stevenson Mar 30 '20 at 07:17
  • It's not really about how to invoke the Cloud Function. It's about how to get the current cloud functions instances IP address during runtime ( the one that's currently being invoked ) and pass it to external API provider in the request. @DougStevenson – KKaar Mar 30 '20 at 07:21
  • 1
    Also no reliably available. The cloud infrastructure can change at any time. You could maybe check IP ranges based on known google cloud IPs (as described in teh duplicate), but that's about it. – Doug Stevenson Mar 30 '20 at 07:22
  • Thanks for your quick replies. So pretty much the only way to handle this inside GCP would be to use Compute Engine instances and get the IP from there - right? @DougStevenson – KKaar Mar 30 '20 at 07:25
  • That's one way to do it. – Doug Stevenson Mar 30 '20 at 07:26

0 Answers0