Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
336 views
in Technique[技术] by (71.8m points)

firebase - How to use the same IP address in different Google Cloud projects

I'm developping an app that uses Firebase (Google Cloud) for back-end application. The project containts several Firebase Functions that are used to get data from a third party that only accept one validated fixed IP address (which I managed to do via a VPC).

My start production is soon so I felt it would be a good time now to set two different environnements, one for developpement and one for production, which would mean two different Google Cloud projects (I want to separate the databases and the functions if I add some new features) with the same IP address. Is there a way to share this setting between two different Google Cloud projects ?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here my idea, even if I never tested it.

On your current project, create 2 Internet network endpoint group (INEG).

  • INEG-prod that use the fully qualified url of your firebase prod environment
  • INEG-dev that use the fully qualified url of your firebase dev environment

Then create a Load balancer in the project where your IP address is reserved; Create 2 backend:

  • Backend-prod that use the INEG-prod
  • Backend-dev that use the INEG-dev

Then the URL map

  • use your /* (for example) to route the request to the backend-prod
  • use dev-/* (for example) to route the request to the backend-dev

On the frontend, use your static IP, and the HTTPS protocol.

It should work (wait about 5 minutes to let the HTTPS load balancer to take into account the configuration)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...