Making API Calls to a Salesforce server using a Static IP from a serverless environment in GCP.

Aditya Vashistha
5 min readOct 21, 2020

Prerequisites:

  1. Basic Understanding of Cloud deployments.
  2. A Google Cloud Console project.
  3. Knowledge of deploying Node.js app on GCP App Engine.
  4. Knowledge of deploying Infrastructure on GCP using Terraform.
  5. Setting up an Nginx Reverse Proxy Server.

This article illustrates how we set-up a GCP infrastructure that enabled our application deployed on App Engine to make API calls to a server that requested a Static IP for whitelisting.

Why?

We needed to deploy this infrastructure because App Engine is a highly scalable, fully managed serverless platform [1] but does not provide Static IP addresses to make API calls.

We had an application deployed on App Engine that needed to make API calls to a Salesforce server residing at an on-premise location. The requirement was that there be a whitelisted static IP address from where the Salesforce server is being hit. The API was a traditional SOAP API request which returned data specific to each user that logged into the application.

Components

We needed three significant components to make the SOAP API requests successfully.

  1. A server that was set up as a reverse proxy that routed requests to the correct destination.
  2. A NAT Gateway with a Static External IP address that made it possible to make API requests over the internet.
  3. A VPC Connector that allowed communication between our serverless application and our VPC network.

The final architecture would look like this:

Final Architecture

The Compute VM, Cloud NAT and VPC connector resided in the VPC network we created in the us-central1 region.

How?

We used Terraform and Google Cloud Foundation Toolkit scripts to deploy our infrastructure. Terraform is the most popular Infrastructure as Code (IaC) tool in…

Aditya Vashistha

I am a Data and Cloud Engineer with a keen interest in deploying scalable solutions on the Cloud.