Verify/change application region at Google App Engine
Asked Answered
S

3

21

I'm creating a GAE application.

When I set my GAE PHP application as an authorized application to access my Cloud SQL instance, I get the following warning:

App Engine regions must be the same as Cloud SQL instance regions!

How can I verify or change the region of my GAE application?

Thx

Sandusky answered 10/9, 2014 at 13:17 Comment(3)
Did you setup either the app or the Cloud SQL to work in the EU?Ceilidh
I set up my cloud sql in asia region but I forgot on my application. where can i find the region on my application? @BruyereSandusky
Related: #25589746Pumpernickel
H
25

You can use gcloud app describe --project <projectId> command to get the location. You cannot change an app's region after you set it. Refer here.

For example:

$ gcloud app describe --project myapp-1337
authDomain: gmail.com
codeBucket: staging.myapp-1337.appspot.com
defaultBucket: myapp-1337.appspot.com
defaultHostname: myapp-1337.appspot.com
featureSettings:
  splitHealthChecks: true
gcrDomain: us.gcr.io
id: myapp-1337
locationId: us-central
name: apps/myapp-1337
servingStatus: SERVING
Hasdrubal answered 20/12, 2017 at 8:35 Comment(0)
M
7

You can see the location of your application at [1].

Regarding changing the region, please see [2] for more information.

[1] - https://appengine.google.com/
[2] - Change GAE application location

region in the google app engine dashboard

Update: EU app creation is now possible from the new Developers console and doesn't require whitelist / premier status. Looks like the Location tab will only show in the GAE console if the account was whitelisted / Premier. A way to find the app location is still in the old GAE console -> from the list, click on the app to go to the dashboard -> if you see e~ in the link after app_id=, your app is in EU. If you see s~, your app is in the US.

Maciemaciel answered 10/9, 2014 at 15:22 Comment(15)
when i look at appengine.google.com. I have only 4 column table, 'application', 'title', 'storage scheme', and 'status'. Is the 'location' column available for everyone?Sandusky
And for changing my region, so if my cloud sql setup in asia region its impossible if i change my application to asia region too? what the best way can i do? change and create a new cloud sql instance and make same with my app region? Sorry i am just a newbie and thank you so much for your help.Sandusky
Your app is located in US. Asia region is not available for App Engine, only for GCE and CloudSQL. If you want to have an App in Europe, you'll have to fill in the form and wait till your email is whitelisted. Afterwards you'll be able to choose a region (EU or US) when creating a new App.Maciemaciel
Sorry, my bad. Location column only appears if you have the ability to create EU Apps.Maciemaciel
Oke i got the solve, i create a new cloud sql instance in US region so my app can connect to there.. thank you so much for your help nikita :)Sandusky
The answer's first link is now obsolete and the second link never answered the related question.Pumpernickel
@Pumpernickel First link is not obsolete. Change of region for created app is not possible. Its necessary to create a new app, deploy and migrate Datastore (e.g. Datastore Admin), domain mappings, etc.Maciemaciel
@NikitaUchaev Its obsolete in that it does not display the application's location. Is this feature supported?Pumpernickel
@Pumpernickel Specially for you I took this from my GAE console. Is your account whitelisted for EU app creation?Maciemaciel
@Pumpernickel Doesn't look like this option works correctly from the new console. I created a new EU project, but still see US for location in the old GAE console (and my account is premier). Do you have an option to select EU when creating an app from the old console?Maciemaciel
@NikitaUchaev No, I'm not. That's really confusing and should be considered a "Major" bug.Pumpernickel
@Pumpernickel EU app creation is now working correctly. Still, location tab will only show in the GAE console only if account was whitelisted / Premier. A way to find app location is still in the old GAE console -> from the list click on the app to go to the dashboard -> if you see e~ in the link after app_id=, your app is in EU, else if you see s~ your app is in the US.Maciemaciel
@NikitaUchaev I highly recommend editing your last comment into your answer. A sincere thank you for your attention and patience!Pumpernickel
@NikitaUchaev It looks like this option is also no longer valid - The old Appengine console no longer shows any "e~" or "s~" in the AppIDPassionate
@ yaraju Still there in the old console for me. Proof.Maciemaciel
P
1

You can get the AppId from the runtime environment:

Java:

ApiProxy.getCurrentEnvironment().getAppId()

or Python:

os.environ['APPLICATION_ID']

where the prefixes as mentioned by @Ilya and @Nikita still apply:

prefixed with e~ means EU and s~ means US.

P.S. It looks like both the dev consoles have been updated to get the App ID from elsewhere, so they don't have this prefix.

Passionate answered 1/6, 2015 at 10:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.