Alibaba Cloud is one of the leading cloud providers in the APAC region. It offers several automation tools out of the box — inside the Alibaba Cloud portal as well as command-line tools. In this post, we will take a look at the command-line tools (here after addressed as CLI).
You can run the CLI to provision new resources or manage existing ones.
You can perform all the tasks from the Alibaba Cloud portal as well, but with the CLI you can automate these tasks; think of CI/CD and DevOps.
Alibaba Cloud CLI offers the features of Alibaba Cloud platform in your terminal, but it sometimes lags behind. Most of the latest features would first be available through the portal and then made publicly available in the CLI.
You can control multiple accounts with the CLI, and work with multiple projects in the same pipeline. The CLI also provide output as expected by the admin of the cloud services. For example, you can get the output in a table format. Some services on Alibaba Cloud return the results in a long time, or they might mutate the results over time and that is where CLI will help you listen to updates over time and show them.
You can also run Alibaba Cloud CLI in a Docker environment. This is helpful especially when you want to run some commands during the resource uptime.
As a plus point, or for the benefit of overall development experience, Alibaba Cloud CLI also offers auto-completion for your commands in the bash terminals.
In order to use the Alibaba Cloud CLI, you would need to configure the credentials that the CLI will use while communicating with the servers / platform.
You can start with the configure command for
Alibaba Cloud allows you to use it with RPC-like commands, as well as REST API commands. For the API commands, you can use the
POST, etc. verbs and perform the operation. For the RPC you can send the command directly to the server.
For example you can use the
aliyun ecs <command>, such as
aliyun ecs StopInstance. Check the sample commands to learn more about this behavior. You can also use the
help command to learn more about the commands; such as
aliyun ecs help.
Well, that's pretty much it about the Alibaba Cloud CLI. Alibaba Cloud is actively developing and maintaining their CLI, and you can review their code or contribute to the code base as you like.