0
0
GCPcloud~5 mins

GCP Console walkthrough - Commands & Configuration

Choose your learning style9 modes available
Introduction
The GCP Console is a web interface that helps you manage your Google Cloud resources easily. It solves the problem of managing cloud services without needing to use complex commands.
When you want to create a new virtual machine without using command line tools
When you need to check the status of your cloud resources quickly
When you want to monitor usage and billing information in one place
When you want to configure access permissions for your team members
When you want to deploy a simple app using Google Cloud services with guided steps
Commands
This command opens a browser window to log in to your Google account and authenticate your CLI session with GCP.
Terminal
gcloud auth login
Expected OutputExpected
Go to the following link in your browser: https://accounts.google.com/o/oauth2/auth?... You are now logged in as [your-email@example.com].
This command lists all the Google Cloud projects you have access to, helping you choose which project to work on.
Terminal
gcloud projects list
Expected OutputExpected
PROJECT_ID NAME PROJECT_NUMBER my-sample-project Sample Project 123456789012
This command shows all the virtual machine instances running in your current project, so you can see what resources are active.
Terminal
gcloud compute instances list
Expected OutputExpected
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS example-vm us-central1-a e2-medium false 10.128.0.2 34.68.123.45 RUNNING
This command creates a new virtual machine named example-vm in the specified zone with a medium machine type.
Terminal
gcloud compute instances create example-vm --zone=us-central1-a --machine-type=e2-medium
Expected OutputExpected
Created [https://www.googleapis.com/compute/v1/projects/my-sample-project/zones/us-central1-a/instances/example-vm]. NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS example-vm us-central1-a e2-medium false 10.128.0.3 34.68.123.46 RUNNING
--zone - Specifies the location where the VM will run
--machine-type - Defines the size and power of the VM
This command deletes the example-vm virtual machine without asking for confirmation, cleaning up resources you no longer need.
Terminal
gcloud compute instances delete example-vm --zone=us-central1-a --quiet
Expected OutputExpected
Deleted [https://www.googleapis.com/compute/v1/projects/my-sample-project/zones/us-central1-a/instances/example-vm].
--quiet - Skips confirmation prompt to delete immediately
Key Concept

If you remember nothing else, remember: the GCP Console and gcloud CLI let you manage cloud resources easily without complex setup.

Common Mistakes
Trying to create a VM without specifying the zone
The command fails because GCP needs to know where to place the VM physically.
Always include the --zone flag with a valid zone like us-central1-a.
Not logging in before running gcloud commands
Commands fail because you are not authenticated to access your cloud resources.
Run 'gcloud auth login' first to authenticate your session.
Deleting a VM without the --quiet flag and expecting no prompt
The command pauses asking for confirmation, which can interrupt scripts.
Use --quiet to skip confirmation when you want automated deletion.
Summary
Use 'gcloud auth login' to authenticate your Google Cloud session.
List projects and resources with 'gcloud projects list' and 'gcloud compute instances list'.
Create and delete virtual machines with 'gcloud compute instances create' and 'gcloud compute instances delete'.