What are the region codes for app engine URLs

148 views Asked by At

Since 2020, App Engine apps are served at [PROJECT].[REGION].r.appspot.com.

Once your app is running in App Engine, you can use the following URL to send HTTP requests to the app: https://PROJECT_ID.REGION_ID.r.appspot.com where PROJECT_ID is the ID of the Google Cloud project that contains the app.

I think this is part of GCP moving internal DNS from global to regional.

The same reference says:

The REGION_ID is an abbreviated code that Google assigns based on the region you select when you create your app. The code does not correspond to a country or province, even though some region IDs may appear similar to commonly used country and province codes. For apps created after February 2020, REGION_ID.r is included in App Engine URLs. For existing apps created before this date, the region ID is optional in the URL.

Empirically, I can see that [REGION] resolves to 'ts' for an app deployed in australia-southeast1, but 'ey' for an app in europe-west3.

How can I derive what URL my app is going to deploy too in any region?

1

There are 1 answers

3
NoCommandLine On

You can use the gcloud CLI. Execute the command

gcloud app describe --project=<PROJECT_ID>

One of the attributes returned is defaultHostname and it will have a value with format

[PROJECT].[REGION].r.appspot.com