×
Community Blog Query Alibaba Cloud Resources with Steampipe

Query Alibaba Cloud Resources with Steampipe

This article introduces Steampipe and explains how it can help reduce the manual steps to execute on Alibaba Cloud’s web console and retrieve details from the command line.

By Ankit Mehta

Methods to Get a List of Resources on Alibaba Cloud

There are three methods to get a list of Alibaba Cloud resources: Alibaba Cloud Management Console, Alibaba Cloud CLI, and Steampipe.

Alibaba Cloud Management Console

Users can get a list of Alibaba Cloud resources using the Resource Group feature provided by the Resource Management service:

  • Step 1: Log in to your Alibaba Cloud account and go to the Resource Management service
  • Step 2: Go to the Resource Group section and click Default Resource Group:

1

  • Step 3: Click the Resource tab, and you will see a list of all your Alibaba Cloud resources:

2

Alibaba Cloud CLI

Another way to list Alibaba Cloud resources is using the Alibaba Cloud Command Line Interface (CLI). It reduces the need to log on to the web console and retrieve account information via the command line. However, the Alibaba Cloud CLI requires some programming skills to work with it.

The following is an example of listing OSS buckets in an Alibaba Cloud account using the CLI:

3

Steampipe

Steampipe is a savior with the slightest learning curve to querying Alibaba Cloud resources from the command line. Basic SQL knowledge is required to get started with Steampipe.

What Is Steampipe?

Steampipe allows you to communicate with Alibaba Cloud APIs using basic SQL commands. Steampipe is an open-source project enabling contributors to develop the project further.

Steampipe currently provides the following plugins and modules for Alibaba Cloud:

  • alicloud: It is a plugin to list Alibaba cloud resources.
  • alicloud_compliance: It is a module that helps validate cloud infrastructure against the CIS benchmark.
  • alicloud_thrifty: It is a module that helps validate cloud infrastructure from a FinOps perspective.

Setting up Steampipe for Alibaba Cloud

Installing Steampipe

  • Step 1: Run brew tap turbot/tap
  • Step 2: Run brew install steampipe to install Steampipe

Note: You can run steampipe -v to check the installed version.

4

Configuring Steampipe

Note: Alibaba Cloud credentials (Access Key and Secret Key) are required to configure Steampipe. Make sure you have these available before continuing with this guide.

  • Step 1: Run steampipe plugin install alicloud to install the Alibaba Cloud plugin
  • Step 2: Configure your credentials in the following file ~/.steampipe/config/alicloud.spc

5

Query Alibaba Cloud Resources with Steampipe

Use Case 1: List your OSS buckets with name, region, account_id, and versioning details

6

Use Case 2: List your OSS buckets from the ‘eu-central-1’ region

7

Conclusion

Steampipe is an easy-to-use tool that can reduce your burden in auditing your Alibaba Cloud infrastructure. It is also possible to extend the Steampipe functionality to check the infrastructure for CIS benchmark rules.

Resources

0 0 0
Share on

Alibaba Cloud Community

1,042 posts | 256 followers

You may also like

Comments

Alibaba Cloud Community

1,042 posts | 256 followers

Related Products

  • Resource Management

    Organize and manage your resources in a hierarchical manner by using resource directories, folders, accounts, and resource groups.

    Learn More
  • Cloud Shell

    A Web browser-based admin tool that allows you to use command line tools to manage Alibaba Cloud resources.

    Learn More
  • RAM(Resource Access Management)

    Secure your cloud resources with Resource Access Management to define fine-grained access permissions for users and groups

    Learn More
  • Function Compute

    Alibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.

    Learn More