Google Cloud Shell provides you with command-line access to computing resources hosted on Google Cloud Platform and is available now in the Google Cloud Platform Console. Cloud Shell makes it easy for you to manage your Cloud Platform Console projects and resources without having to install the Google Cloud SDK and other tools on your system. With Cloud Shell, the Cloud SDK gcloud command and other utilities you need are always available when you need them.

In this codelab, you will learn how to connect to computing resources hosted on Google Cloud Platform via the web. You will learn how to use Cloud Shell and the Cloud SDK gcloud command.

This tutorial is adapted from https://cloud.google.com/cloud-shell/docs/quickstart and https://cloud.google.com/sdk/gcloud/

What you'll learn

What you'll need

How will you use use this tutorial?

Read it through only Read it and complete the exercises

How would you rate your experience with using Google Cloud Platform services and Firebase?

Novice Intermediate Proficient

Codelab-at-a-conference setup

The instructor will be sharing with you temporary accounts with existing projects that are already setup so you do not need to worry about enabling billing or any cost associated with running this codelab. Note that all these accounts will be disabled soon after the codelab is over.

Once you have received a temporary username / password to login from the instructor, log into Google Cloud Console: https://console.cloud.google.com/.

Here's what you should see once logged in :

Note the project ID you were assigned ( "codelab-test003" in the screenshot above). It will be referred to later in this codelab as PROJECT_ID.

Launch Cloud Shell

We're going to make use of a new feature of Google Cloud Platform called Google Cloud Shell, an interactive shell that can be used to manage your Cloud Resources and to do development work directly from the Google Developers Console.

Google Cloud Shell provides you with command-line access to computing resources hosted on Google Cloud Platform and is available now in the Google Cloud Platform Console. Cloud Shell makes it easy for you to manage your Cloud Platform Console projects and resources without having to install the Google Cloud SDK and other tools on your system. With Cloud Shell, the Cloud SDK gcloud command and other utilities you need are always available when you need them. It also comes preinstalled with tools you'd often use. E.g. git, maven, java virtual machine (jvm), nodejs, python, npm.

To get started:

  1. Visit the Google Cloud Platform Console
  2. Click on the "Activate Google Cloud Shell" icon in top right hand corner of the header bar

A Cloud Shell session opens inside a new frame at the bottom of the console and displays a command-line prompt.

  1. Wait until the codelabuser-xxxx@devshell:~$ prompt appears

After Cloud Shell launches, you can use the command line to invoke the Cloud SDK gcloud command or other tools available on the virtual machine instance. You can also use your $HOME directory in persistent disk storage to store files across projects and between Cloud Shell sessions. Your $HOME directory is private to you and cannot be accessed by other users.

Let's get started by taking a look at the commands available to you. Try this:

$ gcloud -h

Simple usage guidelines are available by adding -h onto the end of any gcloud invocation. More verbose help can be obtained by appending --help flag, or executing gcloud help COMMAND.

Give it a try:

$ gcloud config --help

Now try

$ gcloud help config

You will notice that gcloud config --help and gcloud help config commands are equivalent—both give long, detailed help.

Let's try to view the list of configuration in our environment. From reading the long, detailed help in our previous step, we know we can use the command gcloud list.

$ gcloud config list

You may wonder whether there are other properties that was not set. You can see all properties by calling:

$ gcloud config list --all

Summary

In this step, you launched Cloud Shell and called some simple gcloud commands.

You learned how to launch Cloud Shell and ran some sample gcloud commands.

Learn More

License

This work is licensed under a Creative Commons Attribution 2.0 Generic License.