UpdateConfigRule
Modifies the description, input parameters, and risk level of a rule.
Operation description
This topic provides an example 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 the rule ID, see ListConfigRules. |
cr-a260626622af0005**** |
| Description |
string |
No |
The description of the rule. You can enter up to 500 characters. |
You can define up to 6 tag groups. If a resource has all the 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
This parameter is required when ConfigRuleTriggerTypes is set to ScheduledNotification. Valid values:
|
One_Hour |
| ResourceTypesScope |
array |
No |
The types of resources to be evaluated by the rule. Separate multiple resource types with commas (,). |
ACS::ECS::Instance |
|
string |
No |
The types of resources to be evaluated by the rule. 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 generate the token on your client, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. |
1594295238-f9361358-5843-4294-8d30-b5183fac**** |
| RegionIdsScope |
string |
No |
The IDs of the regions in which the rule takes effect. The rule applies only to resources in the specified regions. Separate multiple region IDs with commas (,). Note
This parameter applies only to rule templates. |
cn-hangzhou |
| ExcludeRegionIdsScope |
string |
No |
The IDs of the regions in which the rule does not take effect. The rule does not evaluate resources in the specified regions. Separate multiple region IDs with commas (,). |
cn-shanghai |
| ExcludeResourceIdsScope |
string |
No |
The IDs of the resources that are not evaluated by the rule. Separate multiple resource IDs with commas (,). Note
This parameter applies only to rule templates. |
lb-t4nbowvtbkss7t326**** |
| ResourceIdsScope |
string |
No |
The IDs of the resources to which the rule applies. Separate multiple resource IDs with commas (,). |
lb-5cmbowstbkss9ta03**** |
| ConfigRuleTriggerTypes |
string |
No |
The trigger mechanism of the rule. Valid values:
Note
This parameter can be modified only for custom rules. |
ConfigurationItemChangeNotification |
| ResourceGroupIdsScope |
string |
No |
The IDs of the resource groups to which the rule applies. The rule applies only to resources in the specified resource groups. Separate multiple resource group IDs with commas (,). Note
This parameter applies only to rule templates. |
rg-aekzc7r7rhx**** |
| ExcludeResourceGroupIdsScope |
string |
No |
The IDs of the resource groups to which the rule does not apply. The rule does not evaluate resources in the specified resource groups. Separate multiple resource group IDs with commas (,). |
rg-bnczc6r7rml**** |
TagKeyScope
deprecated
|
string |
No |
[Deprecated] Use the TagsScope parameter instead. The rule applies only to resources that are bound to the specified tag. Note
This parameter applies only to rule templates, and TagKeyScope and TagValueScope must be set at the same time. |
ECS |
TagValueScope
deprecated
|
string |
No |
[Deprecated] Use the TagsScope parameter instead. The rule applies only to resources that are bound to the specified tag. Note
This parameter applies only to rule templates, and TagKeyScope and TagValueScope must be set at the same time. |
test |
| TagKeyLogicScope |
string |
No |
The logical relationship when the TagsScope parameter has multiple values. For example, if the TagsScope parameter is set to "TagsScope.1.TagKey":"a","TagsScope.1.TagValue":"a","TagsScope.2.TagKey":"b","TagsScope.2.TagValue":"b" and this parameter is set to AND, the rule applies only to resources that are bound to both the a:a and b:b tags. If this parameter is left empty, the default logical relationship OR is used. This parameter can also be used for the deprecated TagKeyScope parameter (not recommended). For example, if the TagKeyScope parameter is set to ECS,OSS and this parameter is set to AND, the rule applies only to resources that are bound to both the ECS and OSS tags. 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 name of the rule. For information about how to obtain the rule name, see ListAggregateConfigRules. |
All specified tags exist |
| Conditions |
string |
No |
The conditions for custom condition rules 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 in conjunction with the 24-hour periodic trigger to set the trigger time. |
{"fixedHour":"12"} |
Tag
deprecated
|
array<object> |
No |
[Deprecated] The tags of the resource. Ignore this parameter. It does not take effect even if it is specified. You can bind up to 20 tags to a resource. |
|
|
object |
No |
The tags of the resource. You can bind up to 20 tags to a resource. |
||
| 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 names. |
i-xxx |
For more information about common request parameters, see Common parameters.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| 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.