Google Cloud CLI

Google Cloud CLI is a command line interface (CLI) that allows users to perform operations on Google Cloud service using commands. It allows operations related to resource management of cloud services, which are usually performed using a console on a web browser, to be executed as Linux commands. Therefore, it can be used to connect Genkai to cloud services, for example, by automatically performing a series of investigations using shell scripts.

Please note that the Genkai account contract does not include cloud service resources. the center does not accept requests for contracting cloud services on behalf of or using cloud services. ct the following for information on using AWS.

Talk to a Google Cloud sales specialist

Module

Module name Version
gcloudcli 447.0.0


Preparation

Google account creation

To use the Google Cloud CLI, you must create a Google Cloud account, which is the same Google account you use for Gmail and other Google services. For information on how to create a Google account, see below.

Create a Google Account

Google Cloud project creation

A Google Cloud project is a contractual unit for the use of Google Cloud services, including billing and resource management. You can use Google Cloud services by creating a Google Cloud project with your Google Account. For more information on how to create a Google Cloud project, please visit the following page.

Google Cloud

Login and initial configuration of Google Cloud

To use Google Cloud services with the Google Cloud CLI, you must sign in to Google Cloud and perform the initial setup using the following command on Genkai.

$ module load gcloudcli
$ gcloud init --no-launch-browser

When executed, you will see the authentication URL as shown below. Copy and paste the entire URL into the URL field of your PC browser to open the page.

Go to the following link in your browser, and complete the sign-in prompts:

https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=3255594055
9.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fsdk.cloud.google.com%2Fau
thcode.html&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email
...

After that, when you sign in to your Google Account using a browser, you will see a verification code in your browser. Copy and paste it into Genkai after the following message to complete the sign-in.

Once finished, enter the verification code provided in your browser:

The available project IDs are displayed as shown below, so select the project you want to use. Project ID information can be viewed in the console when you sign in to Google Cloud using a web browser.

Pick cloud project to use:
 [1] xxxxxxxxxxxxxx
 [2] yyyyyyyyyyyyyy
 [3] Enter a project ID
 [4] Create a new project
Please enter numeric choice or text value (must exactly match list item):  

If the Google Cloud Compute Engine API is enabled in advance, you will also select the region of the compute resource to use when the virtual machine starts. After that, the initial configuration is complete with these settings as defaults.



Usage

Select a module

To start using the Google Cloud CLI, log in to Genkai and select the gcloudcli module with the following command.

$ module load gcloudcli

Run Google Cloud CLI commands

The Google Cloud CLI allows you to perform various operations on Google Cloud by specifying Google Cloud CLI command names for the gcloud command. The names of the Google Cloud CLI commands that can be executed can be viewed below.

$ gcloud help

Reference

Please see below for detailed instructions on using the Google Cloud CLI.