EvaluatePreConfigRules
Executes precheck rules to perform a compliance precheck on resources.
Operation description
For more information about the concepts, operating principles, and integration process of precheck rules, see Definition and operating principles of precheck rules.
Precheck rules and rule templates share the same source. After you create a resource, precheck rules can continuously monitor the compliance of the resource.
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 starting token for the query. |
ros |
| ResourceEvaluateItems |
array<object> |
Yes |
The list of precheck rule evaluation items. |
|
|
array<object> |
No |
The precheck rule evaluation item. |
||
| ResourceLogicalId |
string |
No |
The logical ID of the resource. Note
If this parameter is empty, it is generated based on the Base64 encoding of |
ResourceLogicId-test |
| ResourceType |
string |
No |
The resource type. For more information about how to obtain the identifier of a precheck rule, see ListPreManagedRules. Note
The |
ACS::ECS::Instance |
| Rules |
array<object> |
No |
The list of precheck rules. |
|
|
object |
No |
The precheck rule. |
||
| Identifier |
string |
No |
The rule identifier. For more information about how to obtain the rule identifier, see ListPreManagedRules. Note
The |
ecs-instance-deletion-protection-enabled |
| InputParameters |
string |
No |
The rule parameters. |
{} |
| ResourceProperties |
string |
No |
The resource configuration items, which are the properties of the resource to be created. Examples include 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 the rule template. Valid values:
|
false |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
None. |
||
| RequestId |
string |
The request ID. |
129ECF1C-7897-1131-BD0F-4B588AC05400 |
| ResourceEvaluations |
array<object> |
The list of resource evaluation results. |
|
|
array<object> |
The resource evaluation result. |
||
| ResourceLogicalId |
string |
The logical ID of the resource. Note
If the request parameter is empty, it is automatically generated based on the Base64 encoding of |
ResourceLogicId-test |
| ResourceType |
string |
The resource type. |
ACS::ECS::Instance |
| Rules |
array<object> |
The list of precheck rules. |
|
|
object |
The precheck rule. |
||
| Identifier |
string |
The rule identifier. |
ecs-instance-deletion-protection-enabled |
| ComplianceType |
string |
The compliance type of the precheck rule. Valid values:
|
NON_COMPLIANT |
| Annotation |
string |
The reason for non-compliance. |
{\"configuration\":\"false\",\"desiredValue\":\"True\",\"operator\":\"StringEquals\",\"property\":\"$.DeletionProtection\"} |
| HelpUrl |
string |
The documentation link for the remediation guidance of the managed rule. |
https://example.aliyundoc.com |
For more information about common request parameters, 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.