Cloud CLIs: the next step in cloud access

Cloud CLIs: the next step in cloud access

Published on: Category: IT development and operations

Usually, a user's first venture into a cloud will be by using the Web Console. On a small scale, this works fine. But as resource usage grows and you need to perform more repetitive tasks, or even scripting, the Web Console will outgrow its usefulness. The Cloud command-line interface (CLI) will be the next logical step.

For Qualogy, I've looked at the CLI offers of the Cloud providers we use the most: Google GCP, Oracle OCI and Amazon AWS.

Installation and configuration (all on Centos Linux)

For all three, you need the software and a cloud account with enough permissions. Everything can be installed and configured in 10-15 minutes if you have the account details and a key (the key will be attached to your cloud account). Oracle and Amazon require Python for installation. Google can be installed using YUM on Red Hat like distributions. 

Keep in mind that for Oracle, you have to decide which CLI you want to install: the Oracle cloud infrastructure or the classic cloud infrastructure.

Google and Amazon are the fastest to configure. Oracle can take a bit of time, as they ask a lot of questions and require you to look up a lot of IDs. Amazon lets you chose during installation in which format you want the output (JSON, text or table). With Oracle, the default output will be in JSON. Oracle also has the option to show output as a table to improve readability.

Google will, by default, pretty-print the output, and has about 6 other options for displaying the output.

Use

For all three CLIs, the commands you can send to the cloud are pretty logical. Only Oracle’s commands can get a bit messy if you don't define or export the various OCIDs beforehand. OCIDs are Oracle's way of identifying your resources, but they tend to be around 80 characters long.

Let's look at a simple command to list the content for a bucket called 'test-bucket':

  1. With Google, you would enter 'gsutil ls gs://test-bucket/'
  2. With Amazon, you would enter 'aws s3 ls s3://test-bucket/'
  3. With Oracle, you would enter 'oci os object list -ns <your name-space> -bn test-bucket'

As you can see, they don't differ too much. Now take a look at the creation of this bucket in the three clouds:

  1. oci os bucket create --name test-bucket --compartment-id ocid1.compartment.oc1..aaaaaaaajz624sif7zhfunijmhjnrbu3qlste24cvxp247lmqi4qxmausqqa
  2. gsutil mb -p test -c regional -l europe-west4-a gs://test-bucket
  3. aws s3 mb s3://test-bucket

Here, you can see Oracle's use of the OCIDs and why you should export or define them first.

Conclusion

The cloud CLIs for these cloud providers all have some learning curve, but they are very useful when your cloud resources grow.

Oracle has it quirks, but can be used just as well as the others, who both have had more time to mature.

For people who are new to the cloud and have Cloud Engineer aspirations, I can only recommend you start using the CLIs as early as possible.

Mike Nieuwstraten
About the author Mike Nieuwstraten

Mike Nieuwstraten is a System and Network Administrator at Qualogy. He specializes in On-premise, Cloud Infrastructure, Integration and Automation, with a focus on the Google - and Oracle Cloud.

More posts by Mike Nieuwstraten