EvaluatePreConfigRules

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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 ResourceProperties.

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 ResourceType, Identifier, and ResourceProperties parameters must be specified at the same time.

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 ResourceType, Identifier, and ResourceProperties parameters must be specified at the same time.

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 ResourceType, Identifier, and ResourceProperties parameters must be specified at the same time.

{"ResourceGroupId":"","Memory":8192,"InstanceChargeType":"PostPaid","Cpu":2}

EnableManagedRules

boolean

No

Specifies whether to enable the rule template. Valid values:

  • true: Enables the rule template.

  • false: Does not enable the rule template. Default value: false.

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 ResourceProperties.

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:

  • COMPLIANT: Compliant.

  • NON_COMPLIANT: Non-compliant.

  • NOT_APPLICABLE: Not applicable.

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.