All Products
Search
Document Center

Cloud Config:GetConfigRule

Last Updated:Apr 12, 2024

Queries the details of a rule.

Operation description

This topic provides an example on how to query the details of the cr-7f7d626622af0041**** rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:GetConfigRuleRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ConfigRuleIdstringYes

The rule ID.

For more information about how to obtain the ID of a rule, see ListConfigRules .

cr-7f7d626622af0041****

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

811234F4-C3AB-4D15-B90B-F55016D1B5AA
ConfigRuleobject

The details of the rule.

RiskLevelinteger

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

  • 1: high.
  • 2: medium.
  • 3: low.
1
InputParametersobject

The input parameters of the rule.

Sourceobject

The information about how the rule was created.

SourceDetailsobject []

The details of the source of the rule.

MessageTypestring

The trigger type of the rule. Valid values:

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

The event source.

Note Only aliyun.config is returned, which indicates that only events related to Cloud Config are supported.
aliyun.config
MaximumExecutionFrequencystring

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

  • One_Hour
  • Three_Hours
  • Six_Hours
  • Twelve_Hours
  • TwentyFour_Hours
Note This parameter is returned if the rule is periodically triggered.
One_Hour
Ownerstring

The type of the rule. Valid values:

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

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 custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of a function.
acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config
ConfigRuleStatestring

The status of the rule. Valid values:

  • ACTIVE: The rule is enabled.
  • DELETING: The rule is being deleted.
  • EVALUATING: The rule is being used to evaluate resource configurations.
  • INACTIVE: The rule is disabled.
ACTIVE
MaximumExecutionFrequencystring

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

  • One_Hour
  • Three_Hours
  • Six_Hours
  • Twelve_Hours
  • TwentyFour_Hours
Note This parameter is returned if the rule is periodically triggered.
One_Hour
ManagedRuleobject

The details of the managed rule.

SourceDetailsobject []

The details of the source of the managed rule.

MessageTypestring

The trigger type of the rule. Valid values:

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

The event source.

Note Only aliyun.config is returned, which indicates that only events related to Cloud Config are supported.
aliyun.config
MaximumExecutionFrequencystring

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

  • One_Hour
  • Three_Hours
  • Six_Hours
  • Twelve_Hours
  • TwentyFour_Hours
Note This parameter is returned if the rule is periodically triggered.
One_Hour
Descriptionstring

The description of the managed rule.

Labelsarray

The rule tags.

string

The tag of the managed rule.

["RAM","User"]
Identifierstring

The identifier of the managed rule.

ram-user-mfa-check
OptionalInputParameterDetailsobject

The settings of the optional input parameters for the managed rule.

ManagedRuleNamestring

The name of the managed rule.

CompulsoryInputParameterDetailsobject

The settings of the required input parameters for the managed rule.

ConfigRuleArnstring

The ARN of the managed rule.

acs:config::100931896542****:rule/cr-7f7d626622af0041****
Descriptionstring

The description of the managed rule.

CreateByobject

The information about the creation of the rule.

CompliancePackIdstring

The compliance package ID.

cp-541e626622af008****
CompliancePackNamestring

The name of the compliance package.

CreatorNamestring

The name of the account that was used to create the rule.

Alice
CreatorIdstring

The ID of the account that was used to create the rule.

100931896542****
ConfigRuleNamestring

The name of the rule.

ConfigRuleEvaluationStatusobject

The information about compliance evaluations performed by the rule.

LastErrorCodestring

The error code returned for the previous failed compliance evaluation.

TimeOut
LastSuccessfulEvaluationTimestamplong

The timestamp generated when the previous successful compliance evaluation of the rule ended. Unit: millisecond.

1624932227486
FirstActivatedTimestamplong

The timestamp generated when the rule was first triggered. Unit: millisecond.

1624932221993
FirstEvaluationStartedboolean

Indicates whether resource configurations were evaluated based on the rule. Valid values:

  • true: Resource configurations were evaluated based on the rule.
  • false: Resource configurations were not evaluated based on the rule.
true
LastSuccessfulInvocationTimestamplong

The timestamp generated when the previous successful compliance evaluation of the rule started. Unit: millisecond.

1624932227476
LastErrorMessagestring

The error message returned for the previous failed compliance evaluation.

Time out
LastFailedEvaluationTimestamplong

The timestamp generated when the previous failed compliance evaluation of the rule ended. Unit: millisecond.

1614687022000
LastFailedInvocationTimestamplong

The timestamp generated when the previous failed compliance evaluation of the rule started. Unit: millisecond.

1614687022000
ConfigRuleIdstring

The rule ID.

cr-7f7d626622af0041****
ModifiedTimestamplong

The timestamp generated when the rule was last updated. Unit: millisecond.

1614687022000
CreateTimestamplong

The timestamp generated when the rule was created. Unit: millisecond.

1604684022000
ResourceTypesScopestring

The type of the resource to be evaluated by the rule.

ACS::RAM::User
RegionIdsScopestring

The ID of the region to which the rule applies.

global
ExcludeResourceIdsScopestring

The ID of the resource excluded from the compliance evaluations performed by the rule.

23642660635687****
ResourceGroupIdsScopestring

The ID of the resource group to which the rule applies.

rg-aekzdibsjjc****
TagKeyScopestring

The tag key used to filter resources. The rule applies only to the resources with the specified tag key.

Note The TagKeyScope and TagValueScope parameters are returned at the same time.
RAM
TagValueScopestring

The tag value used to filter resources. The rule applies only to the resources with the specified tag value.

Note The TagKeyScope and TagValueScope parameters are returned at the same time.
MFA
ConfigRuleTriggerTypesstring

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule was triggered by configuration changes.
  • ScheduledNotification: The rule was periodically triggered.
ConfigurationItemChangeNotification
Scopeobject

The effective scope of the rule.

ComplianceResourceTypesarray

The types of the resources to be evaluated against the rule. You can also view the resource types by using the ResourceTypesScope parameter.

string

The type of the resource to be evaluated against the rule.

ACS::RAM::User
TagKeyLogicScopestring

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.

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

The details of compliance evaluation results.

ComplianceTypestring

The statistics on the compliance evaluation results by compliance type. Valid values:

  • COMPLIANT: The resource was evaluated as compliant.
  • NON_COMPLIANT: The resource was evaluated as incompliant.
  • NOT_APPLICABLE: The rule did not apply to your resource.
  • INSUFFICIENT_DATA: No resource data was available.
NON_COMPLIANT
Countinteger

The number of evaluated resources.

3
AccountIdlong

The ID of the Alibaba Cloud account to which the rule belongs.

120886317861****

Examples

Sample success responses

JSONformat

{
  "RequestId": "811234F4-C3AB-4D15-B90B-F55016D1B5AA",
  "ConfigRule": {
    "RiskLevel": 1,
    "InputParameters": {
      "test": "test",
      "test2": 1
    },
    "Source": {
      "SourceDetails": [
        {
          "MessageType": "ConfigurationItemChangeNotification",
          "EventSource": "aliyun.config",
          "MaximumExecutionFrequency": "One_Hour"
        }
      ],
      "Owner": "ALIYUN",
      "Identifier": "acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config"
    },
    "ConfigRuleState": "ACTIVE",
    "MaximumExecutionFrequency": "One_Hour",
    "ManagedRule": {
      "SourceDetails": [
        {
          "MessageType": "ConfigurationItemChangeNotification",
          "EventSource": "aliyun.config",
          "MaximumExecutionFrequency": "One_Hour"
        }
      ],
      "Description": "",
      "Labels": [
        "[\"RAM\",\"User\"]"
      ],
      "Identifier": "ram-user-mfa-check",
      "OptionalInputParameterDetails": {
        "test": "test",
        "test2": 1
      },
      "ManagedRuleName": "",
      "CompulsoryInputParameterDetails": {
        "test": "test",
        "test2": 1
      }
    },
    "ConfigRuleArn": "acs:config::100931896542****:rule/cr-7f7d626622af0041****",
    "Description": "",
    "CreateBy": {
      "CompliancePackId": "cp-541e626622af008****",
      "CompliancePackName": "",
      "CreatorName": "Alice",
      "CreatorId": "100931896542****"
    },
    "ConfigRuleName": "",
    "ConfigRuleEvaluationStatus": {
      "LastErrorCode": "TimeOut",
      "LastSuccessfulEvaluationTimestamp": 1624932227486,
      "FirstActivatedTimestamp": 1624932221993,
      "FirstEvaluationStarted": true,
      "LastSuccessfulInvocationTimestamp": 1624932227476,
      "LastErrorMessage": "Time out",
      "LastFailedEvaluationTimestamp": 1614687022000,
      "LastFailedInvocationTimestamp": 1614687022000
    },
    "ConfigRuleId": "cr-7f7d626622af0041****",
    "ModifiedTimestamp": 1614687022000,
    "CreateTimestamp": 1604684022000,
    "ResourceTypesScope": "ACS::RAM::User",
    "RegionIdsScope": "global",
    "ExcludeResourceIdsScope": "23642660635687****",
    "ResourceGroupIdsScope": "rg-aekzdibsjjc****",
    "TagKeyScope": "RAM",
    "TagValueScope": "MFA",
    "ConfigRuleTriggerTypes": "ConfigurationItemChangeNotification",
    "Scope": {
      "ComplianceResourceTypes": [
        "ACS::RAM::User"
      ]
    },
    "TagKeyLogicScope": "120886317861****",
    "Compliance": {
      "ComplianceType": "NON_COMPLIANT",
      "Count": 3
    },
    "AccountId": 0
  }
}

Error codes

HTTP status codeError codeError messageDescription
400ConfigRuleNotExistsThe ConfigRule does not exist.The rule does not exist.
400NoPermissionYou are not authorized to perform this operation.You are not authorized to perform this operation.
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.

Change history

Change timeSummary of changesOperation
2023-04-18The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 404
    delete Error Codes: 503
Output ParametersThe response structure of the API has changed.