Creates or modifies a rule.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | PutConfigRule |
The operation that you want to perform. Set the value to PutConfigRule. |
ConfigRuleName | String | Yes | rds-cpu-min-count-limit-rd |
The name of the rule. |
RiskLevel | Integer | Yes | 1 |
The risk level of the resources that are not compliant with the rule. Valid values:
|
ScopeComplianceResourceTypes | String | Yes | ["ACS::RDS::DBInstance"] |
The types of the resources to be evaluated against the rule. |
SourceDetailMessageType | String | Yes | ConfigurationItemChangeNotification |
The trigger type of the rule. Valid values:
|
SourceIdentifier | String | Yes | rds-cpu-min-count-limit |
The identifier of the rule.
|
SourceOwner | String | Yes | ALIYUN |
Specifies whether you or Alibaba Cloud owns and manages the rule. Valid values:
|
ConfigRuleId | String | No | cr-2a914fcf617e00c9**** |
The ID of the rule. |
Description | String | No | The evaluation result is considered compliant if the number of CPU cores of each ApsaraDB for RDS instance under your account is greater than or equal to the threshold that you set. |
The description of the rule. |
InputParameters | String | No | {"cpuCount": "2"} |
The settings of the input parameters for the rule. |
SourceMaximumExecutionFrequency | String | No | Twelve_Hours |
The frequency of the compliance evaluations. Valid values:
|
ScopeComplianceResourceId | String | No | vpc-6weoy5flv41pj4wvr**** |
The ID of the resource to be evaluated.
|
ClientToken | String | No | TF-dfc5********************3dc |
The client token that is used to ensure the idempotence of the request. You can use the client to generate a token, but you must make sure that it is unique among different requests. The token cannot exceed 64 characters in length and can only contain ASCII characters. |
MultiAccount | Boolean | No | false |
Specifies whether to create or modify the rule under the member accounts of the current master account. Valid values:
Note If you are using Cloud Config for individuals, ignore this parameter.
|
MemberId | Long | No | 1234567 |
The ID of the member account under which the rule is to be created or modified. This parameter is empty by default. This parameter is available only when MultiAccount is set to true.
Note If you are using Cloud Config for individuals, ignore this parameter.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
ConfigRuleId | String | cr-76ac4fcfb57e00c9**** |
The ID of the rule. |
RequestId | String | A7A0FFF8-0B44-40C6-8BBF-3A185EFDF3F7 |
The ID of the request. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=PutConfigRule
&ConfigRuleName=rds-cpu-min-count-limit-rd
&RiskLevel=1
&ScopeComplianceResourceTypes=["ACS::RDS::DBInstance"]
&SourceDetailMessageType=ConfigurationItemChangeNotification
&SourceIdentifier=rds-cpu-min-count-limit
&SourceOwner=ALIYUN
&<Common request parameters>
Sample success responses
XML
format
<PutConfigRuleResponse>
<ConfigRuleId>cr-76ac4fcfb57e00c9****</ConfigRuleId>
<RequestId>A7A0FFF8-0B44-40C6-8BBF-3A185EFDF3F7</RequestId>
</PutConfigRuleResponse>
JSON
format
{
"ConfigRuleId": "cr-76ac4fcfb57e00c9****",
"RequestId": "A7A0FFF8-0B44-40C6-8BBF-3A185EFDF3F7"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ExceedMaxRuleCount | The maximum number of rules is exceeded. | The error message returned because the number of created rules has reached the upper limit. |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | The error message returned because the service is unavailable. |
400 | ConfigRuleNotExists | The ConfigRule does not exist. | The error message returned because the specified rule does not exist. |
400 | ConfigRuleExists | The ConfigRule already exists. | The error message returned because the specified rule already exists. |
404 | AccountNotExisted | Your account does not exist. | The error message returned because your account does not exist. |
For a list of error codes, visit the API Error Center.