All Products
Search
Document Center

Cloud Config:GetCompliancePack

Last Updated:May 23, 2023

Queries the details of a compliance package.

Operation Description

This topic provides an example on how to query the details of a compliance package whose ID is cp-fdc8626622af00f9****. The returned result shows that the name of the compliance package is ClassifiedProtectionPreCheck, the compliance package is in the ACTIVE state, and the risk level of the rules in the compliance package is 1, which indicates high risk level.

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:
    • The required resource types are displayed in bold characters.
    • 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:GetCompliancePackRead
  • Config
    acs:config:*:{#accountId}:*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CompliancePackIdstringYes

The ID of the compliance package.

For more information about how to obtain the ID of a compliance package, see ListCompliancePacks.

cp-a8a8626622af0082****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

6EC7AED1-172F-42AE-9C12-295BC2ADB751
CompliancePackobject

The details of the compliance package.

Statusstring

The status of the compliance package. Valid values:

  • ACTIVE: The compliance package is normal.
  • CREATING: The compliance package is being created.
ACTIVE
CompliancePackIdstring

The ID of the compliance package.

cp-a8a8626622af0082****
RiskLevelinteger

The risk level of the resources that are not compliant with the rules in the compliance package. Valid values:

  • 1: high risk level
  • 2: medium risk level
  • 3: low risk level
1
Descriptionstring

The description of the compliance package.

ConfigRulesarray

The rules in the compliance package.

object
ManagedRuleIdentifierstring

The ID of the managed rule.

eip-bandwidth-limit
ConfigRuleNamestring

The name of the rule.

ConfigRuleIdstring

The ID of the rule.

cr-a260626622af0005****
ConfigRuleParametersarray

The input parameters of the rule.

object
Requiredboolean

Indicates whether the input parameter is required. Valid values:

  • true: required
  • false: optional
true
ParameterNamestring

The name of the input parameter.

bandwidth
ParameterValuestring

The value of the input parameter.

10
Descriptionstring

The description of the rule.

RiskLevelinteger

The risk level of the resources that are not compliant with the rule. Valid values:

  • 1: high risk level
  • 2: medium risk level
  • 3: low risk level
1
CompliancePackNamestring

The name of the compliance package.

AccountIdlong

The ID of the Alibaba Cloud account to which the compliance package belongs.

100931896542****
CompliancePackTemplateIdstring

The ID of the compliance package template.

ct-5f26ff4e06a300c4****
CreateTimestamplong

The timestamp when the compliance package was created. Unit: milliseconds.

1624245766000
Scopeobject

The resource group for which the compliance package takes effect.

RegionIdsScopestring

The ID of the region whose resources are evaluated by using the compliance package.

cn-hangzhou
ExcludeResourceIdsScopestring

The ID of the resource that is not evaluated by using the compliance package.

eip-8vbf3x310fn56ijfd****
ResourceGroupIdsScopestring

The ID of the resource group whose resources are evaluated by using the compliance package.

rg-aekzc7r7rhx****
TagKeyScopestring

The tag key of the resource that is evaluated by using the compliance package.

ECS
TagValueScopestring

The tag value of the resource that is evaluated by using the compliance package.

test

Examples

Sample success responses

JSONformat

{
  "RequestId": "6EC7AED1-172F-42AE-9C12-295BC2ADB751",
  "CompliancePack": {
    "Status": "ACTIVE",
    "CompliancePackId": "cp-a8a8626622af0082****",
    "RiskLevel": 1,
    "Description": "",
    "ConfigRules": [
      {
        "ManagedRuleIdentifier": "eip-bandwidth-limit",
        "ConfigRuleName": "",
        "ConfigRuleId": "cr-a260626622af0005****",
        "ConfigRuleParameters": [
          {
            "Required": true,
            "ParameterName": "bandwidth",
            "ParameterValue": "10"
          }
        ],
        "Description": "",
        "RiskLevel": 1
      }
    ],
    "CompliancePackName": "",
    "AccountId": 0,
    "CompliancePackTemplateId": "ct-5f26ff4e06a300c4****",
    "CreateTimestamp": 1624245766000,
    "Scope": {
      "RegionIdsScope": "cn-hangzhou",
      "ExcludeResourceIdsScope": "eip-8vbf3x310fn56ijfd****",
      "ResourceGroupIdsScope": "rg-aekzc7r7rhx****",
      "TagKeyScope": "ECS",
      "TagValueScope": "test"
    }
  }
}

Error codes

HTTP status codeError codeError messageDescription
400Invalid.CompliancePackId.ValueThe specified CompliancePackId does not exist.The specified compliance pack ID does not exist.
404AccountNotExistedYour account does not exist.The specified 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.