How to change Region / Zone in Google Cloud?

后端 未结 4 1898
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 05:15

I am very new to Google Cloud. I was able to setup a wordpress site and am working on it now. However, it appears that my vm instance is using the following asia-east1-a for i

4条回答
  •  面向向阳花
    2021-02-05 05:53

    If you don't remember the specific commands, another option is to change the region and zone in the gcloud configurations file which is located in:

    ~/.config/gcloud/configurations/config_default
    

    And contain the structure below:

    [core]
    account = my-account@my-domain
    project = my-project
    
    [compute]
    zone = asia-south1-a
    region = asia-south1
    

    After changing region to us-central-1 you'll get the following output:

    gcloud config list compute/region
    [compute]
    region = us-central1
    
    gcloud config configurations list
    NAME     IS_ACTIVE  ACCOUNT               PROJECT     COMPUTE_DEFAULT_ZONE  COMPUTE_DEFAULT_REGION
    default  True       my-account@my-domain  my-project  us-central1-a         us-central1
    

    Reference to all GCP regions and zones.

提交回复
热议问题