code tutorial
code tutorial

Reputation: 664

How to deploy GCP API Gateway and Cloud function together without gcloud commands

We built an API and integrated cloud function as backend. Till now we were deploying cloud function first and API gateway later. Is there a best way to club these two services and deploy it as a whole?

Upvotes: 0

Views: 296

Answers (1)

guillaume blaquiere
guillaume blaquiere

Reputation: 75745

It's 2 different products and no, you can't tie them and deploy in the same time.

  • Cloud Functions build a container based your code and can take more or less time according to the number of dependencies and the type of language (required compilation (Java or Go) or not).
  • API Gateway requires to deploy a new config and to deploy it on a gateway. And it takes a while to achieve these.

So, no link between the product and not the same deployment duration. The right pattern here is to use versioning. You can deploy a service before the others (Cloud Functions before API Gateway) for minor change (doesn't break the existing behavior).

For breaking change, I recommend you to not update the existing functions but to create a new one. The advantage is to have the capacity to continue to have the 2 versions in parallel, and a rapid rollback in case of issue. Same thing for API Gateway, create a new gateway for a new version.

Upvotes: 1

Related Questions