Search code examples
google-cloud-platformgoogle-cloud-rungoogle-vpc

GCP, Cloud Run external IP is not working


I followed this https://cloud.google.com/run/docs/configuring/static-outbound-ip

and it is not working

I can now check the static IP address on the VPC page and Cloud NAT page. (They both have the same address)

Why is that? I can still connect to the default address of Cloud Run https://readme-cloudshell-txt-... and the page appears normally.


Solution

  • The static IP definition for Cloud Run (same for Cloud Functions) is only set for the outbound connection. That means only the communication initiated by the service to reach external endpoints (and you need to allowlist the requester IP on that external endpoint to allow access).

    You can't reach your Cloud Run service on that IP, it's not dedicated to that.

    However, if you want a static IP to reach Cloud Run, you can set a HTTPS load balancer in front of Cloud Run and, this time, you can define IPs on your Load Balancer to reach your serverless backends