This topic describes the limits on SQL query statements in Cloud Config to ensure that you can use SQL query statements for resource search in an efficient manner.
Limits on the search scope
You can use SQL query statements to search for only existing resources. You cannot search for deleted resources.
For statements that use the
SELECT *
syntax, the following properties are returned by default:AccountId
RegionId
ResourceId
ResourceType
ResourceName
ResourceCreationTime
ResourceGroupId
Unsupported query keywords
The following SQL keywords are not supported. The NULL keyword is supported.
ALL
DISTINCT
FROM
HAVING
JOIN
UNION
Limits on wildcards
Wildcards are supported for only property values. Example:
WHERE ResourceId LIKE 'Value%'
.Wildcards are not supported for property keys. For example,
WHERE 'ResourceId%' LIKE 'Value'
is not supported.A wildcard can be used as a suffix. Examples:
ResourceType LIKE 'ACS::ECS::%'
ResourceType LIKE 'ACS::ECS::_'
Limits on aggregate functions
Aggregate functions are supported. Cloud Config imposes specific limits on aggregate functions.
Supported aggregate functions:
AVG
COUNT
MAX
MIN
SUM
Limits on supported aggregate functions:
You can specify only one parameter or property for an aggregate function.
Aggregate functions cannot be nested.
If you use the
GROUP BY
clause together with theORDER BY
clause, an aggregate function can contain only one property.The
HAVING
clause is not supported for aggregate functions.
Example of the query on multiple properties
{
"configTagList": [
{"configTagName": "A", "tagType": "ecs"},
{"configTagName": "B", "tagType": "sls"}
]
}
The following statement can be used to retrieve Resource R:
SELECT * WHERE configTagList.configTagName = 'A' AND configTagList.tagType = 'sls'
Description:
The first condition
configTagList.configTagName = 'A'
is evaluated for all elements in the configTagList array and evaluated as true because Resource R has Tag A.The second condition
configTagList.tagType = 'sls'
is evaluated for all elements in the configTagList array and evaluated as true because Resource R has Tag B whose type is sls.Resource R meets the preceding conditions. As a result, Resource R is returned.