glcoud¶
Installation¶
AUR packages¶
google-cloud-cli(~500 mb) )google-cloud-cli-lite(strips unnecessary dependencies to reduce the size by > 75%)
Components installation doesn't work with AUR packages:
$ gcloud components install config-connector
ERROR: (gcloud.components.install) You cannot perform this action
because this Google Cloud CLI installation is managed by an external package manager.
Please consider using a separate installation of the Google Cloud CLI
created through the default mechanism described at: https://cloud.google.com/sdk/
Therefore it's preferred to install gcloud by other means.
mise¶
Components¶
beta:gcloud betacommandsconfig-connector: i.e. export GCP resources as OpenTofu resources
gke-gcloud-auth-plugin¶
Install as gcloud component, i.e.:
Install as AUR package:
Config¶
- gcloud config reference
- Completion files: gcloud-zsh-complete
- Configuration files:
~/.config/gcloud/configurations/config_* - application-default config files:
~/.config/gcloud/application_default_credentials_*
Use env vars:
In addition to setting properties in a configuration, and the use of flags, it is possible to override the value of a property with an environment variable. The matching environment variable for a property is of the form 'CLOUDSDK_CATEGORY_PROPERTY'. For example, to demonstrate overriding the project property in the core category to my-project, use a command like: CLOUDSDK_CORE_PROJECT=my-project gcloud config get core/project
Setup¶
For every new organization configure a quota project:
gcloud auth application-default set-quota-project <PROJECT_ID>
gcloud config set billing/quota_project <PROJECT_ID>
General usage¶
Filters¶
List domains without pendingContactSettings:
gcloud domains registrations list \
--filter "pendingContactSettings.adminContact=.*" --format "table[no-heading](DOMAIN)"
Auth login¶
Proxy / custom CA cert¶
Use the ca cert bundle (including custom certs):
Cloud SQL¶
gcloud sql backups list --instance=mastodon
gcloud sql backups create --instance=mastodon \
--description="Manual before instance upgrade"
Projects¶
List all projects belonging to an organization: