Loading...
 
Command-line interface for Google Cloud Platform products and services.

Google Cloud SDK

The Cloud SDK is a set of tools for Cloud Platform. It contains gcloud, gsutil, and bq, which you can use to access Google Compute Engine, Google Cloud Storage, Google BigQuery, and other products and services from the command-line. You can run these tools interactively or in your automated scripts.1

References

Installation / Setup

Linux

Quickstart for Linux - This page shows how to install the Google Cloud SDK, initialize it and run core gcloud commands from the command-line.

macOS

Quickstart for macOS - This page shows how to install the Google Cloud SDK, initialize it, and run core gcloud commands from the command-line.

Gcloud

The gcloud CLI manages authentication, local configuration, developer workflow, and interactions with the Google Cloud Platform APIs.2

The principle of least privilege (PoLP; also known as the principle of least authority) is an important concept in computer security, promoting minimal user profile privileges on computers, based on users' job necessities. It can also be applied to processes on the computer; each system component or process should have the least authority necessary to perform its duties. This helps reduce the "attack surface" of the computer by eliminating unnecessary privileges that can result in network exploits and computer compromises.3

gcloud init

Use the gcloud init command to perform several common SDK setup tasks. These include authorizing the SDK tools to access Google Cloud Platform using your user account credentials and setting up the default SDK configuration.4

gcloud init launches an interactive Getting Started workflow for gcloud. It performs the following setup steps:5

  • Authorizes gcloud and other SDK tools to access Google Cloud Platform using your user account credentials, or lets you select from accounts whose credentials are already available.
  • Sets properties in a gcloud configuration, including the current project and the default Google Compute Engine region and zone.
initialize the SDK
$ gcloud init

gcloud config

The gcloud config command group lets you set, view and unset properties used by Cloud SDK.6

list configurations
$ gcloud config configurations list
switch active configuration
$ gcloud config configurations activate default
view setting for active configuration
$ gcloud config list

gcloud info

gcloud info displays information about the current gcloud environment.7

prints information about the current active configuration, including the Google Cloud Platform account, project and directory paths for logs
$ gcloud info
checks network connectivity
$ gcloud info --run-diagnostics
prints the contents of the most recent log file
$ gcloud info --show-log

Last edited by MichaelAlber .
Page last modified on Friday November 23, 2018 00:36:49 UTC.