Modifies the description, input parameters, and risk level of a rule.
Operation description
This topic provides an example on how to change the risk level of the rule cr-a260626622af0005****
to 3
, which indicates low risk level.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
config:UpdateConfigRule | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ConfigRuleId | string | Yes | The ID of the rule. For more information about how to query the ID of a rule, see ListConfigRules . | cr-a260626622af0005**** |
Description | string | No | The description of the rule. You can enter up to 500 characters. | The description of the rule. |
InputParameters | object | No | The input parameters of the rule. | {"tag1Key":"ECS","tag1Value":"test"} |
MaximumExecutionFrequency | string | No | The interval at which the rule is triggered. Valid values:
Note
This parameter is required if the ConfigRuleTriggerTypes parameter is set to ScheduledNotification .
| One_Hour |
ResourceTypesScope | array | No | The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,). | |
string | No | The type of the resource to be evaluated by the rule. | ACS::ECS::Instance | |
RiskLevel | integer | No | The risk level of the resources that do not comply with the rule. Valid values:
| 3 |
ClientToken | string | No | The client token that you want to use to ensure the idempotency of the request. You can use the client to generate the value, but you must make sure that the value 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 to which the rule applies. Separate multiple region IDs with commas (,). Note
This parameter applies only to a managed rule.
| cn-hangzhou |
ExcludeRegionIdsScope | string | No | The IDs of the regions excluded from the compliance evaluations performed by the rule. Separate multiple region IDs with commas (,). | cn-shanghai |
ExcludeResourceIdsScope | string | No | The IDs of the resources excluded from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,). Note
This parameter applies only to a managed rule.
| 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 type of the rule. Valid values:
Note
This parameter applies only to custom rules.
| ConfigurationItemChangeNotification |
ResourceGroupIdsScope | string | No | The IDs of the resource groups to which the rule applies. Separate multiple resource group IDs with commas (,). Note
This parameter applies only to a managed rule.
| rg-aekzc7r7rhx**** |
ExcludeResourceGroupIdsScope | string | No | The IDs of the resource groups excluded from the compliance evaluations performed by the rule. Separate multiple resource group IDs with commas (,). | rg-bnczc6r7rml**** |
TagKeyScope | string | No | The tag key used to filter resources. The rule applies only to the resources with the specified tag key. Note
This parameter applies only to a managed rule. You must configure the TagKeyScope and TagValueScope parameters at the same time.
| ECS |
TagValueScope | string | No | The tag value used to filter resources. The rule applies only to the resources that use the specified tag value. Note
This parameter applies only to a managed rule. You must configure the TagKeyScope and TagValueScope parameters at the same time.
| test |
TagKeyLogicScope | string | No | The logical relationship among the tag keys if you specify multiple tag keys for the
| AND |
TagsScope | array<object> | No | The tag scope. | |
object | No | |||
TagKey | string | No | The key of the tag. | key-1 |
TagValue | string | No | The value of the tag. | value-1 |
ExcludeTagsScope | array<object> | No | The scope of the tag that is excluded. | |
object | No | |||
TagKey | string | No | The key of the tag. | key-2 |
TagValue | string | No | The value of the tag. | value-2 |
ConfigRuleName | string | No | The name of the rule. For more information about how to query the name of a rule, see ListAggregateConfigRules . | The name of the rule. |
ExtendContent | string | No | Optional. The extended content of the resource. This parameter can be used together with the MaximumExecutionFrequency parameter when the MaximumExecutionFrequency parameter is set to TwentyFour_Hours to specify the trigger time. | {"fixedHour":"12"} |
Tag | array<object> | No | The tags of the resource. You can add up to 20 tags to a resource. | |
object | No | The tags of the resource. You can add up to 20 tags to a resource. | ||
Key | string | No | The key of tag N to add to the key pair. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain | key-1 |
Value | string | No | The value of tag N. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain | value-1 |
For more information about common request parameters, see Common parameters.
Response parameters
Examples
Sample success responses
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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|