# Cloud Run functions locations (1st gen)

Cloud Run functions is *regional* , which means the infrastructure that runs a
Cloud Run function is located in a specific region and is managed by
Google to be redundantly available across
[all the zones within that region](https://docs.cloud.google.com/docs/geography-and-regions.md.txt).

When selecting a region to run your Cloud Run functions in, your primary
considerations should be latency and availability. You can
generally select the region closest to your Cloud Run function's users,
but you should also consider the location of the
[other Google Cloud products and services](https://cloud.google.com/about/locations/#locations)
that your app uses. Using services across multiple locations can affect
your app's latency, as well as [pricing](https://cloud.google.com/functions/pricing).

The available regions for Cloud Run functions are listed below. The different
[versions of Cloud Run functions](https://docs.cloud.google.com/run/docs/functions/comparison.md.txt)
have different regional availability.

> [!NOTE]
> **Note:** You can retrieve the latest set of available regions from the gcloud CLI using the [`gcloud functions regions list`](https://docs.cloud.google.com/sdk/gcloud/reference/functions/regions/list) command.

## Tier 1 pricing

Cloud Run functions is available in the following regions with
[Tier 1 pricing](https://cloud.google.com/functions/pricing):

| Region | Location | CO~2~ emissions |
|---|---|---|
| `asia-east1` | Taiwan |   |
| `asia-east2` | Hong Kong |   |
| `asia-northeast1` | Tokyo |   |
| `asia-northeast2` | Osaka |   |
| `europe-west1` | Belgium | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |
| `europe-west2` | London |   |
| `us-central1` | Iowa | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |
| `us-east1` | South Carolina |   |
| `us-east4` | Northern Virginia |   |
| `us-west1` | Oregon | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |

## Tier 2 pricing

Cloud Run functions is available in the following regions with
[Tier 2 pricing](https://cloud.google.com/functions/pricing):

| Region | Location | CO~2~ emissions |
|---|---|---|
| `asia-northeast3` | Seoul |   |
| `asia-southeast1` | Singapore |   |
| `asia-southeast2` | Jakarta |   |
| `asia-south1` | Mumbai |   |
| `australia-southeast1` | Sydney |   |
| `europe-central2` | Warsaw | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |
| `europe-west3` | Frankfurt |   |
| `europe-west6` | Zurich | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |
| `northamerica-northeast1` | Montreal | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |
| `southamerica-east1` | São Paulo | ![leaf icon](https://cloud.google.com/sustainability/region-carbon/gleaf.svg) [Low CO~2~](https://cloud.google.com/sustainability/region-carbon#region-picker) |
| `us-west2` | Los Angeles |   |
| `us-west3` | Salt Lake City |   |
| `us-west4` | Las Vegas |   |

## Select the region

You can select a region for your function during
[deployment](https://docs.cloud.google.com/functions/1stgendocs/deploy.md.txt).

### gcloud

If you are using the Google Cloud CLI, you can specify the region by using
the [`--region`](https://docs.cloud.google.com/sdk/gcloud/reference/functions/deploy.md.txt#--region) flag:

```sh
gcloud functions deploy --no-gen2 FUNCTION_NAME --region=REGION ...
```

Where `REGION` is one of the regions listed above.

### Console

If you are using the Google Cloud console, you can select the region when
you create and deploy a function.

1. In the Google Cloud console, go to the Cloud Run functions Overview
   page.

   [Go
   to the Cloud Run functions Overview page](https://console.cloud.google.com/functions/list)

   Make sure that the project for which you enabled Cloud Run functions
   is selected.
2. Click **Create Function**.

3. In the **Region** field, select a region.

You can deploy functions to different regions within a project, but once the
region has been selected for a function it cannot be changed.

Functions in a given region in a given project must have unique (case
sensitive) names, but functions across regions or across projects can share
the same name.

## Setting a default region

You can set a default region using the Google Cloud CLI as follows:

```bash
gcloud config set functions/region REGION
```

For example:

    gcloud config set functions/region europe-west1

## Data residency

Cloud Run functions provides a data residency guarantee at the function execution
scope (Scope A Compliance---function execution), wherein a given function
provides for data residency for the function invocation/execution.

This compliance applies to both HTTP functions and
[event-driven functions](https://docs.cloud.google.com/functions/1stgendocs/writing.md.txt#event-driven_functions). For
event-driven functions, Cloud Run functions is data residency-compliant from
the moment the upstream product (triggering product) delivers the event to
Cloud Run functions. Hence, it's important to ensure that the upstream
product (such as Cloud Storage or Pub/Sub) is itself data residency-compliant.

## Best practices for changing region

If you need to change a region where a function is deployed, follow the
recommendations below.

### HTTP functions

For HTTP functions, we recommend that you first redeploy your HTTP function to
the destination region (it can have the same name), and then alter your original
function to redirect its HTTP request to the new function. If clients of your
HTTP function support redirects, you can simply change your original function
to return an HTTP redirect status (`301`) along with the URL of your new
function. If your clients do not handle redirects well, you can *proxy* the
request from the original function to the new function by initiating a new
request from the original function to the new function. The final step is to
ensure that all clients are calling the new function.

### Event-driven functions

[Event-driven functions](https://docs.cloud.google.com/functions/1stgendocs/writing.md.txt#event-driven_functions) adopt
an at-least-once event delivery semantic, which means
that under some circumstances they can receive duplicate events, and so should
always be implemented to be *idempotent*. If your function is already
idempotent then you can simply redeploy the function in the new region with the
same event trigger, and remove the old function after you verify that the
new function is correctly receiving traffic. During this transition both
functions will receive events.

If your function is not currently idempotent, or its idempotency does not
extend beyond the region, then we recommend that you first implement
idempotency before moving the function.