Create IBM Cloud Services with the IBM Cloud CLI

Most of the time, I use the IBM Cloud Dashboard with my browser to manage applications, instantiate services and check status. But sometimes, the point-and-click approach is just too slow. So, when I feel the need for speed, I switch over to the IBM Cloud CLI instead. This CLI, which is available for Windows, MacOS and Linux, provides a full-featured alternative to the browser-based IBM Cloud Dashboard.

The IBM Cloud CLI is particularly convenient for quick service instantiation. In the middle of writing code and need to launch an object storage service or a message queue for quick testing? The IBM Cloud CLI gets it done with a single command: ibmcloud resource service-instance-create.

Here’s an example of launching a Cloudant database service named mycloudant with only IAM credentials:

ibmcloud resource service-instance-create mycloudant cloudant lite eu-de -p '{"legacyCredentials": false}'

Here’s another example of launching a tone analyzer service named myta with both IAM and legacy credentials:

ibmcloud resource service-instance-create myta tone-analyzer lite eu-de -p '{"legacyCredentials": true}'

The command typically accepts five parameters (although some services may require more): the instance name, the IBM Cloud catalog service identifier, the service plan, the region code, and whether to support IAM credentials only or both IAM and legacy credentials. Once instantiated, the created services also become visible in the IBM Cloud dashboard:

In the examples above, cloudant and ta are unique service identifiers in the IBM Cloud catalog, while mycloudant and myta are the names of the instantiated services. You can obtain the complete list of available services in the catalog and their identifiers with the ibmcloud catalog service-marketplace command.

To delete an instantiated service, use the ibmcloud resource service-instance-delete command and pass it the instance name. Here’s an example of deleting the tone analyzer service created earlier:

ibmcloud resource service-instance-delete myta

The screenshot below shows an IBM Cloud CLI session using these commands: