Modifies the information of a specified compliance pack in the current account.
Operation description
This topic provides an example on how to change the value of the parameter for the rule eip-bandwidth-limit in the compliance pack cp-a8a8626622af0082**** to 20.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:UpdateCompliancePack |
update |
*CompliancePack
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CompliancePackId |
string |
Yes |
The compliance pack ID. For information about how to obtain the compliance pack ID, see ListCompliancePacks. |
cp-a8a8626622af0082**** |
| Description |
string |
No |
The description of the compliance pack. |
Based on the China Classified Protection of Cybersecurity Level 3 standard, this template provides continuous compliance detection recommendations to help you perform self-checks and fix issues in advance for faster formal assessment |
| RiskLevel |
integer |
No |
The risk level of the compliance pack. Valid values:
Valid values:
|
1 |
| ConfigRules |
array<object> |
No |
The list of rules in the compliance pack. When you modify a compliance pack, if the rule list is empty, the existing rule list remains unchanged. If the rule list is not empty, the new rules replace the existing rules in the rule list. |
|
|
array<object> |
No |
The rule information. |
||
| ManagedRuleIdentifier |
string |
No |
The identifier of the rule template. Cloud Config automatically creates a rule based on the rule template identifier and adds the rule to the current compliance pack. You must specify either |
eip-bandwidth-limit |
| ConfigRuleParameters |
array<object> |
No |
The rule parameter information. |
|
|
object |
No |
The rule parameter information. |
||
| ParameterName |
string |
No |
The name of the rule parameter. The |
bandwidth |
| ParameterValue |
string |
No |
The value of the rule parameter. The |
20 |
| ConfigRuleId |
string |
No |
The rule ID. Cloud Config adds an existing rule to the current compliance pack. You must specify either |
cr-e918626622af000f**** |
| ConfigRuleName |
string |
No |
The name of the rule. |
Detect idle elastic IP addresses |
| Description |
string |
No |
The description of the rule. |
An elastic IP address that is associated with an ECS instance or a NAT gateway and is not idle is considered compliant |
| RiskLevel |
integer |
No |
The risk level of the rule. Valid values:
|
1 |
| ClientToken |
string |
No |
Ensures the idempotency of the request. Generate a parameter value from your client to ensure that the value is unique across different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters in length. |
1594295238-f9361358-5843-4294-8d30-b5183fac**** |
| CompliancePackName |
string |
No |
The name of the compliance pack. For information about how to obtain the compliance pack name, see ListCompliancePacks. |
Classified Protection Level 3 Pre-check Compliance Pack |
| RegionIdsScope |
string |
No |
The compliance pack takes effect only on resources in the specified region IDs. Separate multiple region IDs with commas (,). |
cn-hangzhou |
| ExcludeRegionIdsScope |
string |
No |
The rule does not take effect on resources in the specified regions. Resources in those regions are not evaluated. Separate multiple region IDs with commas (,). |
cn-shanghai |
| ExcludeResourceIdsScope |
string |
No |
The compliance pack does not take effect on the specified resource IDs. Resources with those IDs are not evaluated. Separate multiple resource IDs with commas (,). |
23642660635687**** |
| ResourceIdsScope |
string |
No |
The rule takes effect only on the specified resource IDs. Separate multiple resource IDs with commas (,). |
lb-5cmbowstbkss9ta03**** |
| ResourceGroupIdsScope |
string |
No |
The compliance pack takes effect only on resources in the specified resource group IDs. Separate multiple resource group IDs with commas (,). |
rg-aekzdibsjjc**** |
| ExcludeResourceGroupIdsScope |
string |
No |
The rule does not take effect on resources in the specified resource group IDs. Resources in those resource groups are not evaluated. Separate multiple resource group IDs with commas (,). |
rg-bnczc6r7rml**** |
| TagKeyScope |
string |
No |
The compliance pack takes effect only on resources that are bound with the specified tag key. |
ECS |
| TagValueScope |
string |
No |
The compliance pack takes effect only on resources that are bound with the specified tag value. Note
TagValueScope must be used together 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. Values passed in do not take effect. A maximum of 20 tags can be bound. |
|
|
object |
No |
The tags of the resource. A maximum of 20 tags can be bound. |
||
| Key |
string |
No |
The tag key of the resource. If you specify this parameter, the value cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with You can specify up to 20 tag keys 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, the value can be an empty string. The tag value can be up to 128 characters in length and cannot start with |
value-1 |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| CompliancePackId |
string |
The compliance pack ID. |
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.