Last active
December 19, 2017 18:26
-
-
Save smolin/d91b76b0eb84665e0958a1e4cf157e19 to your computer and use it in GitHub Desktop.
notes on packer-terraform-gcloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# status of various google services | |
https://status.cloud.google.com | |
# configurations, cf # cf https://stackoverflow.com/questions/35744901/how-to-change-the-active-configuration-profile-in-gcloud | |
# | |
# list known configurations: | |
gcloud config configurations list | |
# | |
# switch to a config: | |
gcloud config configurations activate MY_OLD_CONFIG | |
# | |
# shows account and project: | |
gcloud config list | |
# list gcloud accts | |
gcloud auth list | |
# gcloud login w/ service account instead of browser roundtrip: | |
gcloud auth activate-service-account --key-file $GOOGLE_APPLICATION_CREDENTIALS | |
# switch configs (nb: all shells - apparently can't have two shells w/diff configs): | |
gcloud init | |
# list projects available to this account: | |
gcloud projects list | |
# log in to vagrant machine: | |
ssh -i .vagrant/machines/default/virtualbox/private_key ubuntu@127.0.0.1 -p 2222 | |
# or just: | |
vagrant ssh | |
# service account login without browser: | |
gcloud auth activate-service-account --key-file my-sa-credentials.json | |
# ? show GCE permissions from w/in an instance: | |
curl -H 'Metadata-Flavor: Google' http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes | |
# Nice Terraform example: http://container-solutions.com/simple-gce-setup-terraform/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment