Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use region other than us-central1 for Google Cloud Functions

From what I can tell, Google Cloud Functions is only available in us-central1, as the drop-down for selecting a region only allows me to select us-central1, and when I try writing my own deploy script using something different for the region option like us-east4, the deploy fails. Is this the case? Is there some hidden way to enable creating a cloud function in us-east4 or some other region?

update: the linked question clarifies this for Firebase but I would love to see an official answer for Cloud Functions in general. My guess based on what I've found online is that until Cloud Functions is out of beta, it will only be available in us-central1.

like image 333
Sam Johnson Avatar asked Oct 24 '17 04:10

Sam Johnson


People also ask

How do I change the region of a cloud function?

If you are using the Google Cloud CLI, you can specify the region by using the --region flag: gcloud functions deploy FUNCTION_NAME --region= REGION ... Where REGION is one of the regions listed above. If you are using the Google Cloud console, you can select the region when you create and deploy a function.

Is GCP project region specific?

There is no such thing as a region of a GCP project. In other words, region/location is specific to resources, and a GCP project is not permanently tied to a single region/location. For example, you can have a project with multiple BigQuery datasets in different regions.

What is the difference between region and zone in GCP?

Regions are collections of zones. Zones have high-bandwidth, low-latency network connections to other zones in the same region. In order to deploy fault-tolerant applications that have high availability, Google recommends deploying applications across multiple zones and multiple regions.

How many regions Google Cloud is available?

In total, Google operates or is developing nearly 30 data centers around the world. These data centers support Google's current and planned 44 cloud regions – a physical location where it clusters data centers – that are designed to be highly available, fault-tolerant, and concurrently maintainable.


2 Answers

(Updated July 2018) Good news! Cloud Functions is now available in 4 different regions: Iowa (us-central1), South Carolina (us-east1), Tokyo (asia-northeast1), and Belgium (europe-west1).

To specify your region, you can specify --region during deploy, e.g.

$ gcloud functions deploy howdy --trigger-http --region=europe-west1

like image 116
Bret McGowen Avatar answered Sep 25 '22 20:09

Bret McGowen


To view the full list of regions available for Cloud Functions, visit this link:

https://cloud.google.com/functions/docs/locations

Current available regions (June, 2020) are:

Tier 1 pricing

  • us-central1 (Iowa)
  • us-east1 (South Carolina)
  • us-east4 (Northern Virginia)
  • europe-west1 (Belgium)
  • europe-west2 (London)
  • asia-east2 (Hong Kong)
  • asia-northeast1 (Tokyo)

Tier 2 pricing

  • europe-west3 (Frankfurt)
  • europe-west6 (Zurich)
  • us-west3 (Salt Lake City)
like image 29
ScottMcC Avatar answered Sep 24 '22 20:09

ScottMcC