Cloud CLIs: the next step in cloud accessPublished on: Author: Mike Nieuwstraten 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.
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':
- With Google, you would enter 'gsutil ls gs://test-bucket/'
- With Amazon, you would enter 'aws s3 ls s3://test-bucket/'
- 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:
- oci os bucket create --name test-bucket --compartment-id ocid1.compartment.oc1..aaaaaaaajz624sif7zhfunijmhjnrbu3qlste24cvxp247lmqi4qxmausqqa
- gsutil mb -p test -c regional -l europe-west4-a gs://test-bucket
- 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.
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.