Get startedGet started for free

Cloud Shell overview

1. Cloud Shell overview

When you use a cloud service provider, you can access your cloud resources in several different ways. You can use the provider’s console, or a command-line interface, also known as a CLI, from within the console. In this video, we’ll explore Google’s Cloud Shell, an easily accessed CLI, where you interact with your cloud environment. Cloud Shell offers you the ability to manage cloud resources with the command line. It provides a convenient way to enter commands or develop shell scripts that perform tasks in a user’s cloud environment. Cloud Shell’s environment is provided at no cost, but the shell itself is temporary and will shut down after a period of inactivity. After the shell is shut down, you won’t be able to execute production actions or leave production files in the operative system disks. Cloud Shell is accessible through a web browser, so you can use it anywhere, at any time. Utilities like tools and commands are pre-installed, so you can easily start experimenting with and managing your resources right away. Cloud Shell uses the Google Cloud CLI, also called the gcloud CLI, to build and manage resources. The gcloud CLI includes a suite of gcloud commands that perform tasks. These commands are nested into command groups that represent different Google products. For example, imagine you want to create a virtual machine on Google Cloud. To do this, you would use the product Compute Engine. The command group compute can be used in Cloud Shell to initiate the creation or manipulation of Google Cloud Compute Engine resources, like virtual machines. You can also use Cloud Shell to perform a variety of tasks. For example, you can develop and deploy applications. You can even create storage buckets, access databases, and view and edit files. You can also execute Terraform infrastructure as code scripts to build a test, QA, or production environment. As a cloud security analyst, you might use the Cloud Shell to create VPCs, or virtual private clouds, and view your networks in any given region. Remember, VPCs provide network capabilities to resources like virtual machines or containers. Let’s explore how to create a VPC and subnet using Cloud Shell. First, go to cloud.google.com/cloud-console. Then, click the Activate Cloud Shell button in the top right corner of the page. The shell will open in a terminal window right on the web page. The first step to creating a VPC is to enter the following command: gcloud compute networks create labnet --subnet -mode=custom Let’s examine each command: 'gcloud' invokes the gcloud command-line tool, 'compute' is part of a group command that allows you to create or manipulate Compute Engine resources, 'networks' is a subset of the compute command that specifies the Compute Engine network, 'create' is the action you’re instructing the group to execute, and 'labnet' is the name of the network you’re creating. Next, you can create a custom subnet. Subnets in a given region must have unique names. Let’s name it 'labnet-sub'. The full command is gcloud compute networks subnets create labnet-sub --network=labnet Then, --range=10.10.0.0/28 Then, --region=us-east1 This command lists the region and IP range for your Cloud Shell session. Now, let’s view the networks we just created. We’ll run gcloud compute networks list. Here, there are two networks listed. The network named 'default' was created when the project was initiated. You can delete default networks for security purposes. The network named 'labnet' was created by the gcloud command you entered earlier. Last, you can verify the subnets using the following command: gcloud compute networks subnets list --network=labnet The labnet subnet appears, confirming the VPC network was successfully created. Wow, you just explored how to create a VPC and subnet using Cloud Shell. That was a lot of information. If it felt like a challenge, that’s okay. Working in this type of environment will get easier with time and practice. And I’ll be here to encourage you along the way. Remember, Cloud Shell has many capabilities and is a valuable tool to develop your resources from anywhere, anytime.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.