All Products
Search
Document Center

Cloud Config:Search for resources by executing SQL query statements

Last Updated:Sep 07, 2023

You can execute a SELECT statement to search for resources based on fields in the resource properties. For example, you can use this method to search for the memory of an Elastic Compute Service (ECS) instance.

Background information

Before you write a SELECT statement to search for resources, you must obtain the fields and the types of the fields from the properties file of the specified resource type. For more information about properties files, see Alibaba Cloud Config Resource Schema.

Each resource type supported by Cloud Config has a properties file. Properties files are named based on the corresponding resource types. For example, the properties file of the ACS::ECS::Instance resource type is named ACS_ECS_Instance.properties.json. Properties files of different resource types are placed under the config/properties/resource-types path.

Procedure

  1. Log on to the Cloud Config console.

  2. Optional. In the upper-left corner, select an account group.

    This operation is required only if you are using a management account of a resource directory. Otherwise, you do not need to perform the operation.

  3. In the left-side navigation pane, choose Resources > Advanced.

  4. On the Advanced page, click the SQL tab.

  5. On the SQL tab, enter an SQL query statement.

  6. Click Search.

    The resources that meet the search conditions are returned.

    Note

    A maximum of 1,000 resources can be displayed in the resource list. You can click Download Search Result in the upper-right corner to download a CSV file that contains all the resources that meet the search conditions.