Google Cloud
1. Creating a Free Account:
Visit https://cloud.google.com/free
Click on Get started for free
Sign in with Gmail Id
Select Country as India-> Agree and Continue
Click on create new payment profile and fill the details
After Filling the above details, Click on Payment Method:
Click on pay by UPI or QR code and Click on start free
Scan the QR code thorough any of the GPay, PhonePay , Pay-TM etc
Account gets will be created and will be landing at Google Cloud Console
Click on Try it on console
Account created and ready to use the free account for 90 days and 25668 INR is
given for free by google to explore the resources.
Experiment-1:
Creating a Virtual Machine: Configure and deploy a virtual machine with
specific CPU and memory requirements in Google Cloud.
Click in search bar and type Compute Engine or select Compute Engine
Click on create Instance
Give the name for VM instance-> specified as vm1(can be any name typed in
lower case letters)
Select the region->US Central(low) is selected, any region can be selected and
any zone can be selected from that region. Depending on the cost and locality
selection can be made for deploying virtual machine.
Configure the virtual machine based on vCPUs and Memory needed-> E2 series
is selected currently which is low cost and used for day to day computing.
Any virtual machines configuration can be selected based on the requirement.
Click on machine Type-> Select the required machine type Shared-core e2-micro
is selected since it costs less.
Keep advanced configurations default.
Check the cost estimate on right side of the panel which will indicate the monthly
cost for running the Virtual Machine of defined configuration.
Click on create and wait for the vm to be created
Connecting to Virtual Machine:
Click on vm1(virtual machine created) as shown above
Click on SSH and select open in browser window
Click on Authorize
Virtual Machine named vm1 with linux operating system is available for access.
Task- Execute some basic linux commands.
Close the window and back to virtual machine instance.
click on more option specified with three dots click on delete(to delete the
instance).
Click on delete
Check in the notification for complete deletion.
2. Getting Started with Cloud Shell and gcloud: Discover the use of gcloud
commands to manage Google Cloud resources from Cloud Shell.
Click on Cloud Shell:
Cloud Shell will be enabled:
gcloud auth list:
gcloud config list project:
Run the following command to set the project region for this lab:
gcloud config set compute/region REGION
To create a variable for region, run the following command:
export REGION=REGION
Run the following command to create a variable for the zone:
export ZONE=Zone
Create VM Instance by using following commands:
gcloud compute instances create gcelab2 --machine-type e2-medium --zone=us-
central1-a
Check GCloud Console for newly created VM instance named gcelab2
Delete the instance:
by using following command gcloud compute instances delete gcelab2 \
--keep-disks=all \
--zone=us-central1-a
or directly by cloud console:
Click on delete:
3. Cloud Functions: Create and deploy a Cloud Function to automate a specific
task based on Cloud Storage event.
Search for Cloud Storage:
Click Create Bucket:
provide unique name and click on continue
Select Location type and region:
Choose the storage class and continue:
Choose the access control and continue:
Choose the data protect and create:
Creating a Cloud function:
Search for cloud run functions(server less and event driven):
Create function:
Provide the function name and region details:
Provide the trigger details:
Keep rest of the options default and select next:
Select recent python version and deploy:
Cloud Run function created and deployed:
Go to the cloud storage bucket and upload a file:
Select the previously created cloud run function and check the log details, File creation and
updation will be recorded in the log details:
Delete all the cloud Run Functions and Buckets created: