All Products
Search
Document Center

Cloud Config:UpdateConfigRule

Last Updated:Jul 02, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ConfigRuleIdstringYes

The ID of the rule.

For more information about how to query the ID of a rule, see ListConfigRules .

cr-a260626622af0005****
DescriptionstringNo

The description of the rule. You can enter up to 500 characters.

InputParametersobjectNo

The input parameters of the rule.

{"tag1Key":"ECS","tag1Value":"test"}
MaximumExecutionFrequencystringNo

The intervals at which the rule is triggered. Valid values:

  • One_Hour: 1 hour.
  • Three_Hours: 3 hours.
  • Six_Hours: 6 hours.
  • Twelve_Hours: 12 hours.
  • TwentyFour_Hours (default): 24 hours.
Note This parameter is required if you set the ConfigRuleTriggerTypes parameter to ScheduledNotification.
One_Hour
ResourceTypesScopearrayNo

The type of the resource to be evaluated by the rule. Separate multiple resource types with commas (,).

stringNo
ACS::ECS::Instance
RiskLevelintegerNo

The risk level of the resources that are not compliant with the rule. Valid values:

  • 1: high risk level
  • 2: medium risk level
  • 3: low risk level
3
ClientTokenstringNo

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****
RegionIdsScopestringNo

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
ExcludeResourceIdsScopestringNo

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****
ConfigRuleTriggerTypesstringNo

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
  • ScheduledNotification: The rule is periodically triggered.
Note This parameter applies only to custom rules.
ConfigurationItemChangeNotification
ResourceGroupIdsScopestringNo

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****
TagKeyScopestringNo

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
TagValueScopestringNo

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
TagKeyLogicScopestringNo

The logical relationship among the tag keys if you specify multiple tag keys for the TagKeyScope parameter. For example, if you set the TagKeyScope parameter to ECS,OSS and the TagKeyLogicScope parameter to AND, the rule applies to resources with both the ECS and OSS tag keys. Valid values:

  • AND
  • OR
AND
ConfigRuleNamestringNo

The name of the rule.

For more information about how to query the name of a rule, see ListAggregateConfigRules .

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

Response parameters

ParameterTypeDescriptionExample
object
ConfigRuleIdstring

The ID of the rule.

cr-a260626622af0005****
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

{
  "ConfigRuleId": "cr-a260626622af0005****",
  "RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751"
}

Error codes

HTTP status codeError codeError messageDescription
400ExceedMaxRuleCountThe maximum number of rules is exceeded.The maximum number of rules is exceeded.
400ConfigRuleNotExistsThe ConfigRule does not exist.The rule does not exist.
400ConfigRuleExistsThe ConfigRule already exists.The config rule already exists.
404AccountNotExistedYour account does not exist.The specified account does not exist.
503ServiceUnavailableThe 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 timeSummary of changesOperation
No change history