Reputation: 23
I'm working on an API, deployed using Google Cloud's API Gateway. The problem is, every time I redeploy the API (which happens, for example, every time I change the configuration and need to redeploy it) the gateway url changes. This is not a big deal in development, but eventually this will hit production and I need the url to remain the same through different deployments.
How can I "set" the url so that it remains static?
Upvotes: 1
Views: 79
Reputation: 23
Turns out I had made an incorrect assumption: that you needed to redeploy the api-gateway. This was incorrect.
That solution was simple: delete the previous config and deploy the new one. That's it.
Upvotes: 0
Reputation: 1
To avoid gateway url changes you can set up a custom domain for your API . Once a custom domain is set up in the API Gateway, the URL will be consistent.
As per this official document:
A custom domain for your gateway can be implemented by configuring HTTP(S) Load Balancing for API GatewayPREVIEW. Once the HTTP(S) load balancer for your gateway is set up, follow the steps below to update your custom domain's DNS records to point to the new load balancer service.
These steps are also required when using an HTTP(S) load balancer with a Google-managed certificate (which requires a domain). Allocating and using a static IP address is recommended when used with DNS. The specific instructions for this step depend on your DNS provider.
For more information on setting up an HTTP(S) Load Balancer for API Gateway, see Get started with HTTP(S) Load Balancing for API GatewayPREVIEW.
Upvotes: 1