Install and Setup Google Cloud SDK on Ubuntu

Exported on 27-Aug-2021 16:58:38

Install Google Cloud SDK On Debian Based Linux Distros

This Blueprint Installs GCP SDK On Linux Systems Mentioned Below
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
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

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.

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