Modifies the description, input parameters, risk level, and other settings of a rule.
Operation description
This topic provides an example on how to change the risk level of the rule cr-a260626622af0005**** to 3 (low risk).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
config:UpdateConfigRule |
update |
*Rule
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ConfigRuleId |
string |
Yes |
The rule ID. For information about how to obtain a rule ID, see ListConfigRules. |
cr-a260626622af0005**** |
| Description |
string |
No |
The description of the rule. The description can be up to 500 characters in length. |
A maximum of 6 tag groups can be defined. If a resource has all specified tags, it is considered "compliant" |
| InputParameters |
object |
No |
The input parameters of the rule. |
{"tag1Key":"ECS","tag1Value":"test"} |
| MaximumExecutionFrequency |
string |
No |
The execution frequency of the rule. Valid values:
Note
If Valid values:
|
One_Hour |
| ResourceTypesScope |
array |
No |
The resource types to which the rule applies. Separate multiple resource types with commas (,). |
ACS::ECS::Instance |
|
string |
No |
The resource types to which the rule applies. Separate multiple resource types with commas (,). |
ACS::ECS::Instance |
|
| RiskLevel |
integer |
No |
The risk level of the rule. Valid values:
Valid values:
|
3 |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The |
1594295238-f9361358-5843-4294-8d30-b5183fac**** |
| RegionIdsScope |
string |
No |
The rule applies only to resources in the specified region IDs. Separate multiple region IDs with commas (,). Note
This parameter applies only to rule templates. |
cn-hangzhou |
| ExcludeRegionIdsScope |
string |
No |
The rule does not apply to resources in the specified regions. Resources in these regions are not evaluated. Separate multiple region IDs with commas (,). |
cn-shanghai |
| ExcludeResourceIdsScope |
string |
No |
The rule does not apply to the specified resource IDs. Resources with these IDs are not evaluated. Separate multiple resource IDs with commas (,). Note
This parameter applies only to rule templates. |
lb-t4nbowvtbkss7t326**** |
| ResourceIdsScope |
string |
No |
The rule applies only to the specified resource IDs. Separate multiple resource IDs with commas (,). |
lb-5cmbowstbkss9ta03**** |
| ConfigRuleTriggerTypes |
string |
No |
The trigger type of the rule. Valid values:
Note
Only custom rules can have this parameter modified. |
ConfigurationItemChangeNotification |
| ResourceGroupIdsScope |
string |
No |
The rule applies only to resources in the specified resource group IDs. Separate multiple resource group IDs with commas (,). Note
This parameter applies only to rule templates. |
rg-aekzc7r7rhx**** |
| ExcludeResourceGroupIdsScope |
string |
No |
The rule does not apply to resources in the specified resource group IDs. Resources in these resource groups are not evaluated. Separate multiple resource group IDs with commas (,). |
rg-bnczc6r7rml**** |
TagKeyScope
deprecated
|
string |
No |
This parameter is deprecated. Use the The rule applies only to resources that are bound with the specified tag. Note
This parameter applies only to rule templates, and |
ECS |
TagValueScope
deprecated
|
string |
No |
This parameter is deprecated. Use the The rule applies only to resources that are bound with the specified tag. Note
This parameter applies only to rule templates, and |
test |
| TagKeyLogicScope |
string |
No |
The logical relationship when the This parameter can also be used with the deprecated Valid values:
Valid values:
|
AND |
| TagsScope |
array<object> |
No |
The tag scope. |
|
|
object |
No |
|||
| 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 |
|||
| TagKey |
string |
No |
The tag key. |
key-2 |
| TagValue |
string |
No |
The tag value. |
value-2 |
| ConfigRuleName |
string |
No |
The rule name. For information about how to obtain a rule name, see ListAggregateConfigRules. |
All specified tags exist |
| Conditions |
string |
No |
The conditions of the custom condition rule in JSON format. |
{"ComplianceConditions":"{\"operator\":\"and\",\"children\":[{\"operator\":\"StringEquals\",\"featurePath\":\"$.Status\",\"desired\":\"1\",\"featureSource\":\"CONFIGURATION\"}]}"} |
| ExtendContent |
string |
No |
Optional. The extended content. This parameter is used together with the 24-hour periodic trigger to specify the trigger time. |
{"fixedHour":"12"} |
Tag
deprecated
|
array<object> |
No |
[Deprecated] The tags of the resource. This parameter is deprecated. Ignore this parameter because 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. |
key-1 |
| Value |
string |
No |
The tag value. |
value-1 |
| ResourceNameScope |
string |
No |
The rule applies only to resources with the specified resource name. |
i-xxx |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| ConfigRuleId |
string |
The rule ID. |
cr-a260626622af0005**** |
| RequestId |
string |
The request ID. |
6EC7AED1-172F-42AE-9C12-295BC2ADB751 |
Examples
Success response
JSON format
{
"ConfigRuleId": "cr-a260626622af0005****",
"RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ExceedMaxRuleCount | The maximum number of rules is exceeded. | |
| 400 | ConfigRuleNotExists | The ConfigRule does not exist. | The rule does not exist. |
| 400 | ConfigRuleExists | The ConfigRule 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.