If you’re running on Windows, download and launch our new Google Cloud SDK installer. Once the installer completes, you should have gcloud compute available on your system. Using gcloud compute you can easily connect to your VM instances, manage files and running processes on native Windows installations, as well as on Linux and Mac machines.
After working with Amazon Web Services for a few years, I decided to take Google Cloud Platform for a spin. In this post we will get set up with Google Cloud Platform (GCP), and use the CLI to interact with it for a very basic use case (launch, delete an instance). I will also refer to AWS counterpart(s) as and when it makes sense. The idea is to conceptualize automated creation and teardown of entire environments using the idea of projects in GCP.
Before we proceed, it is important to understand the concept of Projects in Google Cloud Platform. A project does not really have a direct counterpart in AWS. A project is a collection of resources and services organized to work together. One project is associated with one billing account. Any communication outside of the project boundaries needs to occur via an external network connection.
- Docker Questions. How to install GCloud and Always Works after Restart On Mac OS HIGH Sierra: Download install package Here Achieved file and drop in your folder. Alpine Install Gcloud. Exe extension on a filename indicates an exe cutable file. Backend-db: # Container ID for our database container image: postgres:12.
- Find GCLOUD software downloads at CNET Download.com, the most comprehensive source for safe, trusted, and spyware-free downloads on the Web. Enter to Search. My Profile Logout.
Setup
- Sign up for Google Cloud Platform Free Tier.
- Download and unzip the Google Cloud SDK. While AWS Command Line Interface is called AWS CLI, GCP’s is called Cloud SDK.
cd google-cloud-sdk
./install.sh
to add the CLI SDK to our path.gcloud init
to initialize the SDK. This will trigger an OAuth flow, authorizing the SDK to make API calls on our behalf.- Once authorized, we will se a list of projects to pick from (If there are any existing ones), or to create a new project. Let us create a new project.
There are several files created in
~/.config/gcloud
which contain the config, logs, credentials, etc. Similar to AWS, which uses ~/.aws
folder.Exploring the CLI
The typical syntax of gcloud CLI is
gcloud [flags ] <group | command>
. This is similar to AWS CLI, where it is aws <command> <subcommand> [<subcommand> ...] [params]
.Here is a compare and contrast to show configuration
vs.
To list out components installed with the CLI, we can use
gcloud components list
command. This is very different than AWS CLI.As we can see, we have the basic components pre-installed, and others can be installed/removed at any time.
gcloud Interactive Shell
Just like in AWS we can use the super awesome AWS Shell, for gcloud, the interactive shell is a part of the
Alpha
component. It can be installed with gcloud components install alpha
, and can be run with gcloud alpha shell
.This has the contextual help as well as smart auto-complete/auto-suggest features similar to the aws-shell.
Creating a Project via gcloud CLI
This is where it gets really interesting, specially when compared to AWS. Before the project can be put to any use, it needs to have Cloud APIs enabled, and to do that, it needs to have billing enabled.
Verify the billing account, which has been initialized after authentication we did during
gcloud init
.Next, we associate, or
link
our project, project-for-my-blog
with this account-id
, like so -We’re not done yet. We need to associate services to this project. We can list the available services by using
list --available
command.Since we need the compute services enabled, we will enable it by using
service-management --enable <service-name>
.Now that we got the billing and the service-management sorted out, we can issue
compute
commands.Creating an Instance
Next, we will create an instance. This is much easier compared to AWS, as gcloud defaults pretty much everything except for the name and zone of the instance.
We can verify the default values by issuing a
describe
command, just like AWS.To summarize, the instance is a Debian8 (Jessie) VM, type n1-standard-1 (1 vCPU, 3.75G RAM), has a Public IP, a 10GB Standard Persistent Disk (HDD).
In AWS terms, the AMI is
Debian GNU/Linux 8 (Jessie)
, instance type is m3.medium
, with a 10G HDD Root Volume, no EBS volume, in the Default VPC
’s Public Subnet
.We can
ssh
into this instance. Note that we did not deal with any keypair
like we do with AWS. However, as we try to ssh
into this instance, gcloud will create a keypair for us.Feel free to play around with the instance. Here is how to install Apache2.
However, if we try to use the public IP from our browser, the connection will fail. This is because only
ssh
(port 22) access is allowed by default.We can compare this to AWS where the Default VPC Security Group allows all traffic to all ports from
0.0.0.0/0
.Deleting the Instance
Deleting the instance is also straightforward, needing only the name and the zone.
Deleting the Project
Finally, we can delete the project. This is not an instantaneous action though - as GCP lets us
undelete
a project for up to a certain time (30 days?). Once the project is deleted, an email is sent informing the same. Deleting a project will delete all the resources associated with it.Conclusion
While this is barely scrarching the surface of GCP, in this post we were able to get a brief introduction to using GCP via command line, and drive a very basic use case in an automated manner with no UX involvement. Please tweet/DM me with your feedback, and what would you like to see next.
Map all popular cloud services as regular drives and save space on your SSD as there is no need to download online files to your computer. Keep your cloud services safe and secure with data encryption. Select one of your accounts in Google Drive, Amazon S3, OneDrive, and Dropbox connect them to your computer via CloudMounter and manage them in Finder for free.
Owners of a previous version can upgrade at 50% off
Connect Dropbox to your computer
Install Gcloud Sdk Windows
![Download Gcloud Mac Download Gcloud Mac](/uploads/1/2/6/6/126679922/868494225.png)
A convenient way to manage multiple Dropbox accounts.
Dropbox client for Mac
Want to have hassle-free access to all your files in Dropbox connect it to your computer as a virtual drive with the help of CloudMounter. One or more Dropbox accounts can be easily accessed directly from Finder with no need to sync the data.
Move data around your computer and Dropbox cloud accounts securely thanks to CloudMounter’s encryption feature. Take care of online data save keeping.
Move data around your computer and Dropbox cloud accounts securely thanks to CloudMounter’s encryption feature. Take care of online data save keeping.
Map Google Drive on Mac
Make all your Google Drive accounts accessible from one spot.
Download Gcloud Cli
Mount Google Drive as network drive
Download Gcloud Sdk
Connect as many Google Drive accounts as you wish to your computer as there is no limit of connections in CloudMounter. Make your online information easy to reach.
All of your online spreadsheets and documents are handled as if there are your local files without being saved on your Mac. Map Google Drive as network drive for convenient data management and benefit from all CloudMounter’s features.
All of your online spreadsheets and documents are handled as if there are your local files without being saved on your Mac. Map Google Drive as network drive for convenient data management and benefit from all CloudMounter’s features.