调用CreateAggregateCompliancePack接口为指定账号组创建合规包。
每个企业管理账号在每个账号组中最多创建5个合规包。
本文将提供一个示例,为账号组ca-f632626622af0079****
创建一个合规包“等保三级预检合规包”,该合规包中有一条托管规则eip-bandwidth-limit
。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | CreateAggregateCompliancePack | 要执行的操作,取值:CreateAggregateCompliancePack。 |
CompliancePackTemplateId | String | 否 | ct-5f26ff4e06a300c4**** | 合规包模板ID。 关于如何获取合规包模板ID,请参见ListCompliancePackTemplates。 |
CompliancePackName | String | 是 | 等保三级预检合规包 | 合规包名称。 |
Description | String | 是 | 基于等保2.0三级标准,提供持续检测合规性的建议模板,帮助您提前自检并修复问题,以便快速通过正式检测。 | 合规包描述。 |
RiskLevel | Integer | 是 | 1 | 合规包风险等级。取值:
|
AggregatorId | String | 是 | ca-f632626622af0079**** | 账号组ID。 关于如何获取账号组ID,请参见ListAggregators。 |
ConfigRules | Array | 是 | 合规包中的规则列表。 |
|
ManagedRuleIdentifier | String | 否 | eip-bandwidth-limit | 托管规则标识。配置审计根据托管规则标识自动创建规则,并将该规则加入到当前合规包中。
|
ConfigRuleName | String | 否 | 弹性IP实例带宽满足最低要求 | 规则名称。 |
ConfigRuleParameters | Array | 否 | 规则参数信息。 |
|
ParameterName | String | 否 | bandwidth | 规则参数名称。 参数 |
ParameterValue | String | 否 | 10 | 规则参数值。 参数 |
ConfigRuleId | String | 否 | cr-e918626622af000f**** | 规则ID。配置审计将已有规则加入到当前合规包中。
|
Description | String | 否 | 弹性公网已绑定到ECS或者NAT实例,非闲置状态,视为“合规”。 | 规则描述。 |
RiskLevel | Integer | 否 | 1 | 规则风险等级。取值:
|
ClientToken | String | 否 | 1594295238-f9361358-5843-4294-8d30-b5183fac**** | 保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。 |
DefaultEnable | Boolean | 否 | false | 规则是否支持快速启用。取值:
|
RegionIdsScope | String | 否 | cn-hangzhou | 合规包仅对指定地域ID中的资源生效。多个地域ID之间用半角逗号(,)分隔。 |
ExcludeResourceIdsScope | String | 否 | eip-8vbf3x310fn56ijfd**** | 合规包对指定资源ID无效,即不对该资源执行评估。多个资源ID之间用半角逗号(,)分隔。 |
ResourceGroupIdsScope | String | 否 | rg-aekzc7r7rhx**** | 合规包仅对指定资源组ID中的资源生效。多个资源组ID之间用半角逗号(,)分隔。 |
TagKeyScope | String | 否 | ECS | 合规包仅对绑定指定标签键的资源生效。 |
TagValueScope | String | 否 | test | 合规包仅对绑定指定标签键值对的资源生效。 说明 TagValueScope需结合TagKeyScope一起使用。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
CompliancePackId | String | cp-fc56626622af00f9**** | 合规包ID。 |
RequestId | String | CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F | 请求ID。 |
示例
请求示例
http(s)://[Endpoint]/?Action=CreateAggregateCompliancePack
&CompliancePackTemplateId=ct-5f26ff4e06a300c4****
&CompliancePackName=等保三级预检合规包
&Description=基于等保2.0三级标准,提供持续检测合规性的建议模板,帮助您提前自检并修复问题,以便快速通过正式检测。
&RiskLevel=1
&AggregatorId=ca-f632626622af0079****
&ConfigRules=[{"ManagedRuleIdentifier":"eip-bandwidth-limit"]
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateAggregateCompliancePackResponse>
<CompliancePackId>cp-fc56626622af00f9****</CompliancePackId>
<RequestId>CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F</RequestId>
</CreateAggregateCompliancePackResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"CompliancePackId" : "cp-fc56626622af00f9****",
"RequestId" : "CC0CE5EB-E51E-48EB-B4AB-9A9E131ECC0F"
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | CompliancePackExists | The compliance pack already exists. | 合规包名称重复。 |
400 | Invalid.AggregatorId.Value | The specified AggregatorId is invalid. | 账号组ID不存在或无权限使用该账号组。 |
400 | CompliancePackExceedMaxCount | The maximum number of compliance pack is exceeded. | 合规包不能超过5个。 |
400 | Invalid.CompliancePackName.Value | The specified CompliancePackName is invalid. | 合规包名称格式不符合要求。 |
400 | Invalid.CompliancePackTemplateId.Value | The specified CompliancePackTemplateId does not exist. | 合规包模板ID不存在。 |
400 | Invalid.ConfigRules.Empty | You must specify ConfigRules. | 合规包中规则不能为空。 |
400 | Invalid.ConfigRules.Value | The specified ConfigRules is invalid. | 合规包规则中参数输入错误。 |
400 | ConfigRuleExceedMaxRuleCount | The maximum number of config rules is exceeded. | 超过最大的规则创建条数。 |
403 | AggregatorMemberNoPermission | The aggregator member is not authorized to perform the operation. | 账号组内的成员账号无权限执行此操作。 |
404 | AccountNotExisted | Your account does not exist. | 您的账号不存在。 |
503 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | 服务不可用。 |
访问错误中心查看更多错误码。