Domain name for API request: config.intl.tencentcloudapi.com.
This API is used to create a compliance package.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: AddCompliancePack. |
| Version | Yes | String | Common Params. The value used for this API: 2022-08-02. |
| Region | No | String | Common Params. This parameter is not required. |
| ConfigRules.N | Yes | Array of CompliancePackRule | Compliance package rules. |
| RiskLevel | Yes | Integer | Risk level. Valid values: |
| CompliancePackName | Yes | String | Compliance package name. |
| Description | No | String | Description. |
| Parameter Name | Type | Description |
|---|---|---|
| CompliancePackId | String | Compliance package ID. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you how to create compliance packages.
POST / HTTP/1.1
Host: config.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddCompliancePack
<Common request parameters>
{
"ConfigRules": [
{
"Identifier": "sfc-function-settings-check",
"RuleName": "Function settings in function compute meet the specified parameter requirements",
"Description": "Function settings in function compute meet the specified parameter requirements, deemed as 'compliant'."
"RiskLevel": 3,
"ManagedRuleIdentifier": "sfc-function-settings-check",
"InputParameter": [
{
"ParameterKey": "maxMemorySize",
"Type": "Require",
"Value": "512"
}
]
}
],
"RiskLevel": 1,
"CompliancePackName": "Compliance package 12",
"Description": ""
}
{
"Response": {
"CompliancePackId": "cp-33mA27YUlOJWG4sJ53Sx",
"RequestId": "9de42909-38ef-4e54-99de-8f17f5bbf018"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.CompliancePackNameIsNotExist | Compliance package name already exists. |
| InvalidParameter | Parameter error. |
| LimitExceeded.CompliancePackMaxNum | The number of compliance packages has reached the upper limit. |
| ResourceNotFound.RuleIsNotExist | The rule does not exist. |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback