Install and Setup Google Cloud SDK on Ubuntu

Exported on 22-Sep-2021 14:15:19

Install Google Cloud SDK On Debian Based Linux Distros

This Blueprint Installs GCP SDK On Linux Systems Mentioned Below

Google Cloud SDK is a collection of tools which help users to manage resources on Google Cloud Platform. These tools include a platform for managing assets, a command-line interface for Google services and platforms, installed components that simplify common tasks in the cloud, and data importing tools.

Pre-Blueprint Attune setup
  1. On the Inputs tab, create a Linux node for the host you wish to install the stack on.
  2. On the Inputs tab, create Linux credentials to connect to the host you wish to install the stack on.
Supported Operating Systems:
  • Ubuntu
  • Debian

Parameters

Name Type Script Reference Default Value Comment
Linux Node Linux / Unix Server linuxNode
Linux User Linux OS Credential linuxUser
server_credential Linux OS Credential server_credential
server_host Linux / Unix Server server_host

1 - Add package source

Add the Cloud SDK distribution URI as a package source.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

2 - Install Dependencies

Installs apt-transport-https and required dependencies.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
sudo apt-get -y install apt-transport-https ca-certificates gnupg

3 - Import the Google Cloud public key

Import the Google Cloud public key.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

4 - Update apt repositories

Update APT repositories.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
sudo apt update

5 - Start Google Cloud SDK Installation

This starts the installation of the Google Cloud SDK.

Once the installation has finished, you can run "gcloud init" and complete the authentication process to begin using Google Cloud CLI.

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
sudo apt-get install -y google-cloud-sdk