Tập tành check regions list trong Gcloud bằng command line
23rd May 2022To check your preferred region
$ gcloud compute regions list
To change compute regions, I select us-east4 region:
$ gcloud config set compute/region us-east4
Updated property [compute/region].
$ gcloud config list compute/region
[compute]
region = us-east4
---------
$ gcloud config list compute/region
Your active configuration is: [default]
[compute] region = us-east4 $ gcloud config list compute/zone
Your active configuration is: [default]
[compute] zone = us-east4-b
------------
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
Add new comment