Outgoing HTTP Request Location on Google App Engine
Asked Answered
T

1

1

I have an API made with NodeJS (NodeJS v10 + Express v4.16 + Node-Fetch v2.3) and into this API, I have one endpoint that need to consume content from a third-party API/Service via HTTP Request (POST)

The problem is: This third-party API only accepts requests coming from Brazil

In the past, my API was hosted on Digital Ocean, but with this rule I have migrated to GCP (since DO doesn't have hosts in Brazil) and created my App Engine Application under region southamerica-east1 (Sao Paulo/Brazil according with this document)

And yeah... It works on my machine ¯|_(ツ)_/¯

What's happening: Sometimes the requests runs Ok, working fine, but after some version updates (I'm using CI/CD to make de deployment) the requests goes down.

The Question: Exist a way to control my application to only use the hosted region to make the outgoing requests??

PS* I'm not using flex env, purposely to prevent auto-scale (and cost elevation). (I don't know if I'm right about it because I'm new on GCP)

Trivium answered 26/9, 2019 at 1:51 Comment(0)
G
1

The IPs of Google Cloud Platform share the same geolocation (US) so I would say that it's expected for the requests to fail. You can have a look at this and this questions for more info and potential workarounds.

Grandioso answered 26/9, 2019 at 7:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.