Skip to content

Automation in Demand: From WebUI to Command Line

command line

Cloud Platform: WebUI vs. Command Line

Many people start using Cloud Platform with the web interface (WebUI). It’s easy to use, with buttons and drag-and-drop features. But as your projects get bigger, the WebUI becomes less efficient.

Here are some of the limitations of the WebUI:

  • Collaboration difficulty: It can be hard for people to work together on projects. For instance, if person A does something on the console, person B has no way of knowing what they did. This makes it difficult to check and intergate each other’s work.
  • Inefficiency for large projects: The WebUI is not designed for big and complicated projects. For example, creating one virtual machine is easy with the WebUI. But if you need to create and manage 300 virtual machines for multiple projects, the WebUI is not a good option.

Command Line for Google Cloud Platform

The command line (CLI) is a more powerful way to use Google Cloud Platform. It is between the WebUI and DevOps. The CLI provides a more powerful and efficient way to manage your cloud resources and it is surprisingly easy to learn and adapt to.

Here are some other advantages that you should consider to use Command line on Google Cloud Platform.

1. Efficiency at Your Fingertips

Time is of the essence in the realm of cloud computing, and the GCP CLI empowers users to execute tasks swiftly without the need to navigate through multiple web pages. Let’s consider an example:

Example: Creating a Virtual Machine Instance

Using the web UI:

  1. Navigate to Compute Engine.
  2. Click on “Create Instance”.
  3. Fill in instance details like machine type, boot disk, and networking.
  4. Click “Create” to deploy the instance.

Using the CLI:

gcloud compute instances create instance-name --machine-type=n1-standard-1 --image-project=debian-cloud --image=debian-10

2. Automation for Streamlined Operations

The GCP CLI isn’t just about executing one-off commands; it’s a powerful automation tool that can streamline repetitive tasks. Consider the following scenario:

Example: Automating Instance Deployment

#!/bin/bash

for i in {1..5}; do
  gcloud compute instances create instance-$i --machine-type=n1-standard-1 --image-project=debian-cloud --image=debian-10 &
done

wait
echo "All instances created successfully."

3. Flexibility and Customization

With the CLI, users have granular control over GCP resources, allowing for customization based on specific requirements. Let’s delve into an example showcasing flexibility:

Example: Customizing Firewall Rules

gcloud compute firewall-rules create allow-http --allow tcp:80 
gcloud compute firewall-rules create allow-https --allow tcp:443

4. Integration with DevOps Tools

For organizations embracing DevOps practices, the GCP CLI seamlessly integrates with various tools, enabling automation and continuous delivery pipelines. Here’s an example of integrating CLI with a deployment script:

Example: Integrating CLI with Deployment Script

#!/bin/bash

# Build and push Docker image
docker build -t gcr.io/project-id/image-name:latest .
docker push gcr.io/project-id/image-name:latest

# Deploy application to GKE
gcloud beta run deploy --image gcr.io/project-id/image-name --platform managed --region us-central1

5. Enhanced Learning and Skill Development

Lastly, working with the CLI fosters a deeper understanding of GCP architecture and APIs, promoting skill development among cloud professionals. Engaging with CLI commands enables users to become proficient in cloud management.

In conclusion, while the GCP web UI offers a user-friendly interface, harnessing the power of the CLI provides unmatched efficiency, automation capabilities, flexibility, and integration options. By mastering the GCP CLI, businesses can optimise their cloud operations, accelerate deployment cycles, and stay ahead in today’s dynamic cloud landscape.

Tags: