All Products
Search
Document Center

Cloud Config:CreateAggregateConfigRule

Last Updated:Jan 24, 2025

Creates a rule for an account group.

Operation description

Limits

You can create up to 200 rules for each management account.

Usage notes

This topic provides an example on how to create a rule based on the required-tags managed rule in the ca-a4e5626622af0079**** account group. The returned result shows that the rule is created and its ID is cr-4e3d626622af0080****.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
config:CreateAggregateConfigRulecreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ConfigRuleNamestringYes

The rule name.

oss-default-encryption-kms
DescriptionstringNo

The description of the rule.

description of rule
InputParametersobjectNo

The input parameter of the rule.

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

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule is triggered by configuration changes.
  • ScheduledNotification: The rule is periodically triggered.
ConfigurationItemChangeNotification
MaximumExecutionFrequencystringNo

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

  • One_Hour
  • Three_Hours
  • Six_Hours
  • Twelve_Hours
  • TwentyFour_Hours (default)
Note This parameter is required if the ConfigRuleTriggerTypes parameter is set to ScheduledNotification.
One_Hour
ResourceTypesScopearrayYes

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

stringYes

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

ACS::ECS::Instance
RiskLevelintegerYes

The risk level of the resources that do not comply with the rule. Valid values:

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

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, 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****
AggregatorIdstringYes

The ID of the account group.

For more information about how to obtain the ID of the account group, see ListAggregators .

ca-a4e5626622af0079****
RegionIdsScopestringNo

The ID of the region to which the rule applies. Separate multiple region IDs with commas (,).

Note This parameter applies only to a managed rule.
cn-hangzhou
ExcludeRegionIdsScopestringNo

The IDs of the regions to which the rule not applies. Separate multiple region IDs with commas (,).

cn-shanghai
ResourceIdsScopestringNo

The IDs of the resources included from the compliance evaluations performed by the rule. Separate multiple resource IDs with commas (,).

lb-5cmbowstbkss9ta03****
ExcludeResourceIdsScopestringNo

The ID of the resource to be 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****
ResourceGroupIdsScopestringNo

The ID of the resource group to which the rule applies. Separate multiple resource group IDs with commas (,).

Note This parameter applies only to a managed rule.
rg-aekzc7r7rhx****
ExcludeResourceGroupIdsScopestringNo

ExcludeResourceGroupIdsScope. Separate multiple resource group IDs with commas (,).

rg-bnczc6r7rml****
TagKeyScopestringNo

The tag key used to filter resources. The rule applies only to the resources with the specified tag key. Separate multiple parameter values with commas (,).

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 with 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
TagsScopearray<object>No

The tag scope.

objectNo
TagKeystringNo

The tag key.

key-1
TagValuestringNo

The tag value.

value-1
ExcludeTagsScopearray<object>No

The scope of the tag that is excluded.

objectNo
TagKeystringNo

The tag key of the resource that you want to exclude.

key-2
TagValuestringNo

The tag value of the resource that you want to exclude.

value-2
SourceOwnerstringYes

The type of the rule. Valid values:

  • ALIYUN: a managed rule.
  • CUSTOM_FC: a custom rule.
ALIYUN
SourceIdentifierstringYes

The identifier of the rule.

  • If you set the SourceOwner parameter to ALIYUN, set this parameter to the name of the managed rule.
  • If you set the SourceOwner parameter to CUSTOM_FC, set this parameter to the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.

For more information about how to query the name of a managed rule, see Managed rules.

required-tags
FolderIdsScopestringNo

The ID of the resource directory to which the rule applies, which means that the resources within member accounts in the resource directory are evaluated based on the rule.

Note
  • This parameter applies only to a rule of a global account group.

  • This parameter applies only to a managed rule.

fd-ZtHsRH****
ExcludeFolderIdsScopestringNo

The ID of the resource directory to which the rule does not apply, which means that the resources within member accounts in the resource directory are not evaluated based on the rule. Separate multiple resource directory IDs with commas (,).

Note
  • This parameter applies only to a rule of a global account group.

  • This parameter applies only to a managed rule.

fd-pWmkqZ****
ExcludeAccountIdsScopestringNo

The ID of the member account to which the rule does not apply, which means that the resources within the member account are not evaluated based on the rule. Separate multiple member account IDs with commas (,).

Note This parameter applies only to a managed rule.
120886317861****
AccountIdsScopestringNo

The IDs of the member accounts to which the rule applies, which means that the resources within the member accounts are evaluated based on the rule. Separate multiple member account IDs with commas (,).

115748125982****
ExtendContentstringNo

The extended content, which is temporarily only used to configure the trigger time with a 24-hour cycle trigger.

{"fixedHour":"12"}
Tagarray<object>No

The tags.

objectNo

The tags of the resource.

You can add up to 20 tags to a resource.

KeystringNo

The tag key.

The tag key cannot be an empty string. The tag key can be up to 64 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://.

You can specify at most 20 tag keys.

key-1
ValuestringNo

The tag values.

The tag values can be an empty string or up to 128 characters in length. The tag values cannot start with aliyun or acs: and cannot contain http:// or https://.

Each key-value must be unique. You can specify at most 20 tag values in each call.

value-1

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

Response parameters

ParameterTypeDescriptionExample
object

N/A.

ConfigRuleIdstring

The rule ID.

cr-4e3d626622af0080****
RequestIdstring

The request ID.

5895065A-196C-4254-8AD8-14EFC31EEF50

Examples

Sample success responses

JSONformat

{
  "ConfigRuleId": "cr-4e3d626622af0080****",
  "RequestId": "5895065A-196C-4254-8AD8-14EFC31EEF50"
}

Error codes

HTTP status codeError codeError messageDescription
400ExceedMaxRuleCountThe maximum number of rules is exceeded.-
400ConfigRuleNotExistsThe ConfigRule does not exist.The rule does not exist.
400ConfigRuleExistsThe ConfigRule already exists.-
400Invalid.AggregatorId.ValueThe specified AggregatorId is invalid.The specified aggregator ID does not exist or you are not authorized to use the aggregator.
403AggregatorMemberNoPermissionThe aggregator member is not authorized to perform the operation.The aggregator member is not authorized to perform the operation.
404AccountNotExistedYour 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
2023-08-18The Error code has changedView Change Details