I use app engine on google cloud for my webserver. The webserver must communicate with APIs to fetch all kind of data from clients.
For a specific client, I need a static IP for my server for it to be whitelisted. However, I can't control this on app engine. I thought about creating somewhere a server acting as a traffic rerouting with a static IP address. What would be the best solutions for this ?
Thanks,
Paul
CodePudding user response:
To set up a static IP address for your App Engine standard environment service, use Serverless VPC Access with Cloud Router and Cloud NAT. By using Serverless VPC Access, you can send egress traffic to your Virtual Private Cloud (VPC) network. By using a network address translation (NAT) gateway on your VPC, you can route the App Engine traffic through a dedicated IP address.
Routing your traffic through Cloud NAT does not cause an additional hop in your networking stack since the Cloud NAT gateway and the Cloud Router provide only a control plane and the packets do not pass through the Cloud NAT gateway or the Cloud Router.
In order to send traffic with external destinations to your VPC network so that it will have the static IP address that you specified, you must change the egress setting to all-traffic
.
And as mentioned by @Ferregina Pelona if you don’t want to apply this for all servers, then you will need to create a proxy so instead of calling the external service you can call the proxy and it calls the service.
Follow the steps mentioned in the document to set up a static outbound IP address.