All Products
Search
Document Center

Cloud Config:UpdateCompliancePack

Last Updated:Oct 15, 2025

Updates the configuration of a specified compliance pack in the current account.

Operation description

This topic provides an example of how to change the parameter value for the eip-bandwidth-limit rule to 20 in the compliance pack cp-a8a8626622af0082****.

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:UpdateCompliancePack

update

*CompliancePack

acs:config:*:{#accountId}:compliancepack/{#CompliancePackId}

None None

Request parameters

Parameter

Type

Required

Description

Example

CompliancePackId

string

Yes

The ID of the compliance pack.

For more information, see ListCompliancePacks.

cp-a8a8626622af0082****

Description

string

No

The description of the compliance pack.

基于等保2.0三级标准,提供持续检测合规性的建议模板,帮助您提前自检并修复问题,以便快速通过正式检测。

RiskLevel

integer

No

The risk level of the compliance pack. Valid values:

  • 1: High risk.

  • 2: Medium risk.

  • 3: Low risk.

1

ConfigRules

array<object>

No

The rules in the compliance pack.

If you leave this parameter empty when you modify the compliance pack, the original rules are retained. If you specify new rules, they replace the original rules.

array<object>

No

None.

ManagedRuleIdentifier

string

No

The identifier of the rule template. CloudConfig automatically creates a rule based on this identifier and adds the rule to the compliance pack.

You must specify either ManagedRuleIdentifier or ConfigRuleId. If you specify both parameters, ConfigRuleId takes precedence. For more information, see ListCompliancePackTemplates.

eip-bandwidth-limit

ConfigRuleParameters

array

No

The parameters of the rule.

object

No

None.

ParameterName

string

No

The name of the rule parameter.

You must specify ParameterName and ParameterValue together, or leave them both empty. If a rule template has a parameter without a default value, you must specify this parameter. For more information, see ListCompliancePackTemplates.

bandwidth

ParameterValue

string

No

The value of the rule parameter.

You must specify ParameterName and ParameterValue together, or leave them both empty. If a rule template has a parameter without a default value, you must specify this parameter. For more information, see ListCompliancePackTemplates.

20

ConfigRuleId

string

No

The rule ID. CloudConfig adds an existing rule to the compliance pack.

You must specify either ManagedRuleIdentifier or ConfigRuleId. If you specify both parameters, ConfigRuleId takes precedence. For more information, see ListConfigRules.

cr-e918626622af000f****

ConfigRuleName

string

No

The name of the rule.

检测闲置弹性公网IP

Description

string

No

The description of the rule.

弹性公网已绑定到ECS或者NAT实例,非闲置状态,视为“合规”。

RiskLevel

integer

No

The risk level of the rule. Valid values:

  • 1: High risk.

  • 2: Medium risk.

  • 3: Low risk.

1

ClientToken

string

No

A client token to ensure the idempotence of the request. Generate a unique token for each request. The ClientToken value can contain only ASCII characters and must be no more than 64 characters long.

1594295238-f9361358-5843-4294-8d30-b5183fac****

CompliancePackName

string

No

The name of the compliance pack.

For more information, see ListCompliancePacks.

等保三级预检合规包

RegionIdsScope

string

No

The compliance pack evaluates only resources in the specified regions. Separate multiple region IDs with commas (,).

cn-hangzhou

ExcludeRegionIdsScope

string

No

The compliance pack does not evaluate resources in the specified regions. Separate multiple region IDs with commas (,).

cn-shanghai

ExcludeResourceIdsScope

string

No

The compliance pack does not evaluate the specified resources. Separate multiple resource IDs with commas (,).

23642660635687****

ResourceIdsScope

string

No

The compliance pack evaluates only the specified resources. Separate multiple resource IDs with commas (,).

lb-5cmbowstbkss9ta03****

ResourceGroupIdsScope

string

No

The compliance pack evaluates only resources in the specified resource groups. Separate multiple resource group IDs with commas (,).

rg-aekzdibsjjc****

ExcludeResourceGroupIdsScope

string

No

The compliance pack does not evaluate resources in the specified resource groups. Separate multiple resource group IDs with commas (,).

rg-bnczc6r7rml****

TagKeyScope

string

No

The compliance pack evaluates only resources that have the specified tag key.

ECS

TagValueScope

string

No

The compliance pack evaluates only resources that have the specified tag key and value.

Note

You must use TagValueScope with TagKeyScope.

test

TagsScope

array<object>

No

The tag scope.

object

No

The effective tags.

TagKey

string

No

The tag key.

key-1

TagValue

string

No

The tag value.

value-1

ExcludeTagsScope

array<object>

No

The excluded tag scope.

object

No

The excluded tags.

TagKey

string

No

The tag key.

key-2

TagValue

string

No

The tag value.

value-2

Tag deprecated

array<object>

No

The tags of the resource. This parameter is deprecated. Ignore this parameter because it is no longer valid.

You can add up to 20 tags.

object

No

The tags of the resource.

You can add up to 20 tags.

Key

string

No

The tag key of the resource.

If you specify this parameter, it cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https:// .

You can specify the tag keys of up to 20 tags at a time.

key-1

Value

string

No

The tag value of the resource. You can specify up to 20 tag values. If you specify this parameter, it can be an empty string.

The tag value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://.

value-1

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

None.

CompliancePackId

string

The ID of the compliance pack.

cp-a8a8626622af0082****

RequestId

string

The request ID.

6EC7AED1-172F-42AE-9C12-295BC2ADB751

Examples

Success response

JSON format

{
  "CompliancePackId": "cp-a8a8626622af0082****",
  "RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid.CompliancePackId.Value The specified CompliancePackId does not exist. The specified compliance pack ID does not exist.
400 CompliancePackExceedMaxCount The maximum number of compliance pack is exceeded.
400 Invalid.ConfigRules.Empty You must specify ConfigRules.
400 Invalid.ConfigRules.Value The specified ConfigRules is invalid. The specified ConfigRules is invalid.
400 ConfigRuleExceedMaxRuleCount The maximum number of config rules is exceeded.
400 CompliancePackAlreadyPending The compliance pack has a pending operation and cannot be updated. The compliance pack has a pending operation and cannot be updated.
400 CompliancePackExists The compliance pack already exists. The compliance pack name already exists.
404 AccountNotExisted Your account does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server. The request has failed due to a temporary failure of the server.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.