Skip to content

Instantly share code, notes, and snippets.

@zoidyzoidzoid
Last active April 25, 2016 15:03
Show Gist options
  • Save zoidyzoidzoid/4545b1c8816eb6573c21b8cc16380c43 to your computer and use it in GitHub Desktop.
Save zoidyzoidzoid/4545b1c8816eb6573c21b8cc16380c43 to your computer and use it in GitHub Desktop.
Example reusable Google Cloud Platform gcloud configuration

Example gcloud config

For people that swap between example-project-1 / example-project-2 or something similar in gcloud often, and get frustrated with doing --project example-project-1 all the time.

If you wanna be able to switch easily across projects (and potentially zones), you can add files like ~/.config/gcloud/configurations/config_reusable-config, and then do gcloud config configurations activate reusable-config, with config_reusable-config looking like:

### tar xzf reuseable_gcloud_configs.tar.gz
[core]
account = [email protected]
project = example-project
[app]
suppress_change_warning = true
[compute]
zone = europe-west1-d
region = europe-west1
[container]
cluster = example-cluster

gcloud config configurations was added to gcloud CLI in version 0.9.79 (2015/09/23)

(You probably don't need the [app] section)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment