PutConfigRule

更新时间:
复制 MD 格式

Creates or modifies a rule for the current account.

Note

This API has been deprecated. We recommend migrating to Config(2020-09-07) - CreateConfigRule for enhanced functionality and continued support. While the deprecated API remains temporarily accessible, no further updates or bug fixes will be provided.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

ConfigRuleId

string

No

The rule ID.

cr-2a914fcf617e00c9****

ConfigRuleName

string

Yes

The name of the rule.

Description

string

No

The description of the rule.

InputParameters

string

No

The input parameters of the rule.

{"cpuCount": "2"}

SourceOwner

string

Yes

The owner of the rule. Valid values:

  • CUSTOM_FC: user-defined function.

  • ALIYUN: managed rule.

ALIYUN

SourceIdentifier

string

Yes

The identifier of the rule.

  • If the rule is a managed rule, the value of this parameter is the identifier of the managed rule.

  • If the rule is a user-defined function, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of the function.

rds-cpu-min-count-limit

SourceDetailMessageType

string

Yes

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule is triggered by configuration changes.

  • ScheduledNotification: The rule is triggered periodically.

ConfigurationItemChangeNotification

SourceMaximumExecutionFrequency

string

No

The frequency at which the rule is executed. Valid values:

  • One_Hour: 1 hour.

  • Three_Hours: 3 hours.

  • Six_Hours: 6 hours.

  • Twelve_Hours: 12 hours.

  • TwentyFour_Hours: 24 hours.

Twelve_Hours

ScopeComplianceResourceId

string

No

The ID of the resource to be evaluated.

  • If you leave this parameter empty, the rule evaluates all resources of the resource types specified by the ScopeComplianceResourceTypes parameter.

  • If you specify this parameter, the rule evaluates only the specified resource.

vpc-6weoy5flv41pj4wvr****

ScopeComplianceResourceTypes

string

Yes

The types of the resources to be evaluated.

["ACS::RDS::DBInstance"]

RiskLevel

integer

Yes

The risk level. Valid values:

  • 1: high risk.

  • 2: medium risk.

  • 3: low risk.

1

ClientToken

string

No

A client token. It is used to ensure the idempotence 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 ClientToken parameter can contain only ASCII characters and cannot exceed 64 characters in length.

1594295238-f9361358-5843-4294-8d30-b5183fac****

MultiAccount

boolean

No

This parameter is scheduled to be deprecated at 00:00:00 on June 30, 2021. The API of the alternative feature, account group, is released at 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to the API of the account group feature after 00:00:00 on May 30, 2021. For more information about account groups, see Account group.

false

MemberId

integer

No

This parameter is scheduled to be deprecated at 00:00:00 on June 30, 2021. The API of the alternative feature, account group, is released at 00:00:00 on May 30, 2021. If you are using this parameter, we recommend that you switch to the API of the account group feature after 00:00:00 on May 30, 2021. For more information about account groups, see Account group.

123456789

Response elements

Parameter

Type

Description

Example

object

N/A.

ConfigRuleId

string

The rule ID.

cr-76ac4fcfb57e00c9****

RequestId

string

The request ID.

A7A0FFF8-0B44-40C6-8BBF-3A185EFDF3F7

Examples

Success response

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.
400 ConfigRuleNotExists The ConfigRule 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.

See for a complete list.

Release notes

See Release Notes for a complete list.