-1

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.

dontknowhy
  • 2,480
  • 2
  • 23
  • 67
  • It’s not clear what you’re asking. What does not work? What you try to do? What’s the relation of the cloud shell readme with the other? Your question is very confusing – Puteri Mar 15 '22 at 08:33
  • @FerreginaPelona Hi I actually saw your answer in different stackoverflow question https://serverfault.com/questions/1054922/cant-access-static-external-ip-for-google-cloud-run-instance-followed-guides, and that question would be mine too I guess but I am still not able to understand exactly.. when I enter the given static ip into url the page doesn`t appear at all // you said "reason behind this title is that Cloud NAT does not allow inbound traffic, i.e., you cannot make requests to the Cloud Run Service using the static IP of the NAT using that as an Endpoint, this is why it is "hanging". – dontknowhy Mar 15 '22 at 10:25

1 Answers1

3

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

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76