All Products
Search
Document Center

Cloud Config:GetConfigRule

Last Updated:Mar 08, 2023

Queries the details of a rule.

Operation Description

This example shows how to query the details of the cr-7f7d626622af0041**** rule.

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 keyAssociation operation
config:GetConfigRuleRead
  • Config
    acs:config:*:{#accountId}:*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ConfigRuleIdstringYes

The ID of the rule.

For more information about how to query 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 ID of the request.

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

The details 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
InputParametersobject

The input parameters of the rule.

Sourceobject

The information about how the rule was created.

SourceDetailsarray

The details of the source of the rule.

object
MessageTypestring

The trigger type of the rule. Valid values:

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

The event source of the managed rule.

NoteOnly events related to Cloud Config are supported. The value is fixed to aliyun.config.
aliyun.config
MaximumExecutionFrequencystring

The intervals at which the managed rule is triggered. Valid values:

  • One_Hour: 1 hour.
  • Three_Hours: 3 hours.
  • Six_Hours: 6 hours.
  • Twelve_Hours: 12 hours
  • TwentyFour_Hours: 24 hours
NoteThis parameter is returned if the rule is periodically triggered.
One_Hour
Ownerstring

The way in which the rule was created. Valid values:

  • CUSTOM_FC: The rule is a custom rule.
  • ALIYUN: The rule was created based on a managed rule of Alibaba Cloud.
ALIYUN
Identifierstring

The identifier of the rule.

  • If the rule was created based on a managed rule, the value of this parameter is the name of the managed rule.
  • If the rule is a custom rule, the value of this parameter is the Alibaba Cloud Resource Name (ARN) of the relevant function in Function Compute.
acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config
ConfigRuleStatestring

The status of the rule. Valid values:

  • ACTIVE: The rule is being used to monitor resource configurations.
  • DELETING: The rule is being deleted.
  • EVALUATING: The rule is triggered and is being used to monitor resource configurations.
  • INACTIVE: The rule is disabled and is no longer used to monitor resource configurations.
ACTIVE
MaximumExecutionFrequencystring

The intervals at which the managed rule is triggered. Valid values:

  • One_Hour: 1 hour.
  • Three_Hours: 3 hours.
  • Six_Hours: 6 hours.
  • Twelve_Hours: 12 hours
  • TwentyFour_Hours: 24 hours
NoteThis parameter is returned if the managed rule is periodically triggered.
One_Hour
ManagedRuleobject

The details of the managed rule.

SourceDetailsarray

The details of the source of the managed rule.

object
MessageTypestring

The trigger type of the rule. Valid values:

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

The event source of the managed rule.

NoteOnly events related to Cloud Config are supported. The value is fixed to aliyun.config.
aliyun.config
MaximumExecutionFrequencystring

The intervals at which the managed rule is triggered. Valid values:

  • One_Hour: 1 hour.
  • Three_Hours: 3 hours.
  • Six_Hours: 6 hours.
  • Twelve_Hours: 12 hours
  • TwentyFour_Hours: 24 hours
NoteThis parameter is returned if the managed rule is periodically triggered.
One_Hour
Descriptionstring

The description of the managed rule.

Labelsarray

The tags of the managed rule.

string
["RAM","User"]
Identifierstring

The identifier of the managed rule.

ram-user-mfa-check
OptionalInputParameterDetailsobject

The optional input parameters of the managed rule.

ManagedRuleNamestring

The name of the managed rule.

CompulsoryInputParameterDetailsobject

The required input parameters of 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 ID of the compliance package.

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 monitoring rule.

ConfigRuleEvaluationStatusobject

The information about compliance evaluations performed by the rule.

LastErrorCodestring

The error code returned for the last failed compliance evaluation.

TimeOut
LastSuccessfulEvaluationTimestamplong

The timestamp when the last successful compliance evaluation of the rule ended. Unit: milliseconds.

1624932227486
FirstActivatedTimestamplong

The timestamp when the rule was first triggered. Unit: milliseconds.

1624932221993
FirstEvaluationStartedboolean

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

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

The timestamp when the last successful compliance evaluation of the rule started. Unit: milliseconds.

1624932227476
LastErrorMessagestring

The error message returned for the last failed compliance evaluation.

Time out
LastFailedEvaluationTimestamplong

The timestamp when the last failed compliance evaluation of the rule ended. Unit: milliseconds.

1614687022000
LastFailedInvocationTimestamplong

The timestamp when the last failed compliance evaluation of the rule started. Unit: milliseconds.

1614687022000
ConfigRuleIdstring

The ID of the rule.

cr-7f7d626622af0041****
ModifiedTimestamplong

The timestamp when the rule was last updated. Unit: milliseconds.

1614687022000
CreateTimestamplong

The timestamp when the rule was created. Unit: milliseconds.

1604684022000
ResourceTypesScopestring

The type of the resource 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 value used to filter resources. The rule applies only to the resources with the specified tag value.

NoteThe 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.

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

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The managed rule is triggered by configuration changes.
  • ScheduledNotification: The managed rule is periodically triggered.
ConfigurationItemChangeNotification
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.

NoteThis parameter applies only to managed rules.
120886317861****
Complianceobject

The details of compliance evaluation results.

ComplianceTypestring

The statistics of compliance evaluation results based on compliance types. Valid values:

  • COMPLIANT: The resources are evaluated as compliant.
  • NON_COMPLIANT: The resources are evaluated as non-compliant.
  • NOT_APPLICABLE: The rule does not apply to your resources.
  • INSUFFICIENT_DATA: No resource data is 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",
    "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.