GCP Cloud Architect - Gcloud Day#2

In order to interact with Google Cloud resources, Google provides a command-line interface called gcloud, which is part of the Google Cloud SDK. Most of the GCP services can be managed from the command line using gcloud. Other GCP services such as Cloud Storage, Cloud BigQuery, Cloud BigTable, and Kubernetes use their specific command-line tools. Cloud Shell, a browser-based shell, comes pre-installed with gcloud and can be used to manage Google Cloud resources without installing Google Cloud SDK on the local machine. The gcloud init command is used to initialize or re-initialize Google Cloud, and it allows the user to choose a new configuration or continue using the existing one. By default, gcloud is installed in Cloud Shell, which is free to use and has a pre-installed code editor and several utilities.

The gcloud config list command is used to display the current configuration settings in your gcloud environment. This command will show you the current project, region, zone, and other settings that are currently set in your gcloud environmen

now we will create the VM using the gcloud run the below command on gcloud shell.

gcloud compute instances create demo-inst --zone=us-central1-a

verifying VM from the console

verifying from the gcloud

The basic syntax of gcloud command is gcloud GROUP SUBGROUP ACTION ..., where GROUP is the service group you want to work with, SUBGROUP is the sub-group within the service you want to interact with, and ACTION is the specific operation you want to perform on that sub-group.

Note: Cloud Shell is a virtual machine instance provided by Google Compute Engine, which comes with 5 GB of persistent disk storage, the latest version of Cloud SDK, Docker, and other software. Any files stored in the home directory persist between sessions. If inactive for more than 20 minutes, the VM instance is automatically terminated, causing any modifications outside the home directory to be lost. Any content in the home directory will be deleted after 120 days of inactivity. Cloud Shell can be used to SSH into virtual machines using their private IP addresses.