Executes evaluation rules to perform compliance pre-checks on resources.
Operation description
For more information about the concepts, operating principles, and integration process of evaluation rules, see Definition and operating principles of evaluation rules.
After you create an evaluation rule, a managed rule with the same settings is created. This managed rule can continuously check the compliance of resources after they are created.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:EvaluatePreConfigRules |
list |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ResourceTypeFormat |
string |
No |
The query start token |
ros |
| ResourceEvaluateItems |
array<object> |
Yes |
An array that contains the resources that you want to evaluate. |
|
|
array<object> |
No |
The resources that you want to evaluate. |
||
| ResourceLogicalId |
string |
No |
The logical ID of the resource. Note
If this parameter is empty, it is generated based on the Base64 value of |
ResourceLogicId-test |
| ResourceType |
string |
No |
The type of the resource. For information about how to obtain the identifier of an evaluation rule, see ListPreManagedRules. Note
The |
ACS::ECS::Instance |
| Rules |
array<object> |
No |
An array that contains the evaluation rules. |
|
|
object |
No |
The evaluation rules. |
||
| Identifier |
string |
No |
The identifier of the rule. For information about how to obtain the identifier of a rule, see ListPreManagedRules. Note
The |
ecs-instance-deletion-protection-enabled |
| InputParameters |
string |
No |
The input parameters of the rule. |
{} |
| ResourceProperties |
string |
No |
The resource configuration items (properties of the resource to be created), such as the specifications, region, name, status, and port or network interface switch status of the resource. Note
The |
{"ResourceGroupId":"","Memory":8192,"InstanceChargeType":"PostPaid","Cpu":2} |
| EnableManagedRules |
boolean |
No |
Specifies whether to enable rule templates. Valid values:
|
false |
For more information, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| RequestId |
string |
The ID of the request. |
129ECF1C-7897-1131-BD0F-4B588AC05400 |
| ResourceEvaluations |
array<object> |
The array that contains the compliance evaluation results. |
|
|
array<object> |
The information about the compliance evaluation results returned. |
||
| ResourceLogicalId |
string |
The logical ID of the resource. Note
If the request parameter is empty, it is automatically generated based on the Base64 value of |
ResourceLogicId-test |
| ResourceType |
string |
The type of the resource. |
ACS::ECS::Instance |
| Rules |
array<object> |
The evaluation rules. |
|
|
object |
The evaluation rules. |
||
| Identifier |
string |
The identifier of the rule. |
ecs-instance-deletion-protection-enabled |
| ComplianceType |
string |
The compliance type of the resource that was evaluated by using the evaluation rule. Valid values:
|
NON_COMPLIANT |
| Annotation |
string |
The reason why the resource was evaluated as incompliant. |
{\"configuration\":\"false\",\"desiredValue\":\"True\",\"operator\":\"StringEquals\",\"property\":\"$.DeletionProtection\"} |
| HelpUrl |
string |
The URL of the topic that describes how the managed rule remediates the non-compliant configurations. |
https://example.aliyundoc.com |
For more information, see Common parameters.
Examples
Success response
JSON format
{
"RequestId": "129ECF1C-7897-1131-BD0F-4B588AC05400",
"ResourceEvaluations": [
{
"ResourceLogicalId": "ResourceLogicId-test",
"ResourceType": "ACS::ECS::Instance",
"Rules": [
{
"Identifier": "ecs-instance-deletion-protection-enabled",
"ComplianceType": "NON_COMPLIANT",
"Annotation": "{\\\"configuration\\\":\\\"false\\\",\\\"desiredValue\\\":\\\"True\\\",\\\"operator\\\":\\\"StringEquals\\\",\\\"property\\\":\\\"$.DeletionProtection\\\"}",
"HelpUrl": "https://example.aliyundoc.com"
}
]
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.