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

Aditya Vashistha
8 min readOct 30, 2020

Prerequisites:

  1. Basic Understanding of Cloud deployments.
  2. A Google Cloud Console project.
  3. Knowledge of Cloud Load balancers.
  4. Knowledge of deploying Infrastructure on GCP using Terraform.
  5. Knowledge of types of Instance Groups in GCP.

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 at scale.

In my previous article, I described how we set-up a standard infrastructure to make API calls to a Salesforce Server from a Static IP. In this article, I will explain how we overcame the limitations of traditional non-scalable deployments.

Why?

On August 8 2020, President Trump signed an executive order creating a Lost Wages Assistance (LWA) program. [1] To receive this LWA benefit, users needed to complete a small certification process through our application, due to which we anticipated an increase in the number of users logging into our application. We estimated the traffic to increase from 1500 users/hour to about 6000 users/hour during peak business hours.

The drawback with setting up a single Compute Instance as a reverse proxy to make the API call is that once the traffic on the application increases, it does not scale automatically, and one would need to add an instance to handle this increase in traffic manually.

We had the application deployed on App Engine which would scale automatically, but with this anticipated increase in the users, we also needed to make the Compute Instance that was set-up as an Nginx Reverse Proxy scale automatically and had to come up with a solution that did that.

How?

Since we needed the Compute VM to scale automatically, we decided to use a Managed Instance Group(MIG), which dynamically adds or removes instances in response to increases or decreases in traffic. Also, we would need a Load Balancer that would properly distribute the traffic amongst the instances that would be created by the…

--

--

Aditya Vashistha

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