1

I am trying to get the public ip address from my GCP project so i can access AWS (protected by ip). I tried using Cloud Shell to get the public ip address of my GCP project or my Google Cloud Functions, but i am not sure what ip is my public ip, or what command should i use. Can someone show me where or how to get the address of my project? or what public ip address Google Functions use?

Cipher
  • 77
  • 1
  • 9
  • https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address – thecloudguy Nov 11 '21 at 20:00
  • Is your question about the public IP address of Cloud Shell or another service? Edit your question with more details. – John Hanley Nov 11 '21 at 20:04
  • Just edited my question, thanks – Cipher Nov 11 '21 at 20:31
  • 1
    1) Google Cloud Projects (the resource) does not have a public IP address. Some services such as Google Compute Engine and load balancers do/can have public IP addresses assigned. 2) Cloud Functions do not have static public IP addresses. You can use Serverless VPC Access with Cloud Functions to route functions traffic through your VPC. https://cloud.google.com/functions/docs/networking/network-settings#associate-static-ip – John Hanley Nov 11 '21 at 20:45
  • @JohnHanley so the region of my cloud function will define the ip address that it use? – Cipher Nov 11 '21 at 20:53
  • Associating function egress with a static IP address https://cloud.google.com/functions/docs/networking/network-settings#associate-static-ip – thecloudguy Nov 11 '21 at 21:27
  • 1
    Yes, the region will affect the range of IP addresses that Cloud Functions use. However, your function does not have its own public IP address. There is a Google frontend that proxies requests. External applications see the frontend's IP address which is a pool of addresses. – John Hanley Nov 11 '21 at 21:47

2 Answers2

1

Google Cloud Projects (the resource) does not have a public IP address. Some services such as Google Compute Engine and load balancers do/can have public IP addresses assigned. 2) Cloud Functions do not have static public IP addresses. You can use Serverless VPC Access with Cloud Functions to route functions traffic through your VPC.

The region will affect the range of IP addresses that Cloud Functions use. However, your function does not have its own public IP address. There is a Google frontend that proxies requests. External applications see the frontend's IP address which is a pool of addresses.

@John Hanley

Vicente Ayala
  • 191
  • 10
0

https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address

List static external IP addresses To list static external IP addresses that you have reserved for your project, use the console, run compute addresses list or make a GET request to the API.

In gcloud Use the compute addresses list command

gcloud compute addresses list
thecloudguy
  • 331
  • 3
  • 8
  • This answer does not apply to Cloud Functions, which is what the OP asked about. It is correct for some services. – John Hanley Nov 11 '21 at 20:47
  • 1
    thanks for the aclaration John – Cipher Nov 11 '21 at 20:48
  • https://cloud.google.com/functions/docs/networking/network-settings#associate-static-ip https://stackoverflow.com/questions/38811882/possible-to-get-static-ip-address-for-google-cloud-functions hope this helps! – thecloudguy Nov 11 '21 at 21:25