Verify/change application region at Google App Engine

前端 未结 3 811
忘了有多久
忘了有多久 2020-12-10 11: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:

相关标签:
3条回答
  • 2020-12-10 12:05

    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.

    0 讨论(0)
  • 2020-12-10 12:10

    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
    
    0 讨论(0)
  • 2020-12-10 12:17

    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

    Update: EU app creation is now possible from the new Developers console and doesn't require whitelist / premier status. Looks like Location tab will only show in the GAE console 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.

    Another alternative is to use gcloud command suggested by Ilya Zakreuski below.

    0 讨论(0)
提交回复
热议问题