Todos os produtos
Search
Central de documentação

Cloud Config:GetConfigRule

Última atualização: Jun 28, 2026

Consulta os detalhes de uma regra especificada.

Descrição da operação

Este tópico fornece um exemplo de como consultar os detalhes da regra cr-7f7d626622af0041****.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

Ação

Nível de acesso

Tipo de recurso

Chave de condição

Ação dependente

config:GetConfigRule

get

*Rule

acs:config:*:{#accountId}:rule/{#ConfigRuleId}

Nenhuma Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

ConfigRuleId

string

Sim

O ID da regra.

Para mais informações, consulte ListConfigRules.

cr-7f7d626622af0041****

Tag deprecated

array<object>

Não

As tags do recurso. Este parâmetro está obsoleto e não tem efeito.

Você pode adicionar no máximo 20 tags a um recurso.

object

Não

As tags do recurso.

Key

string

Não

A chave de tag do recurso.

Você pode adicionar no máximo 20 chaves de tag a um recurso.

key-1

Value

string

Não

O valor de tag do recurso.

Você pode adicionar no máximo 20 valores de tag a um recurso.

value-1

Para mais informações sobre parâmetros de solicitação comuns, consulte Parâmetros comuns.

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

ConfigRule

object

Os detalhes da regra.

AccountId

integer

O ID da conta Alibaba Cloud à qual a regra pertence.

120886317861****

Compliance

object

As estatísticas de conformidade da regra.

ComplianceType

string

The compliance evaluation result. Valid values:

  • COMPLIANT: The resource is compliant.

  • NON_COMPLIANT: The resource is non-compliant.

  • NOT_APPLICABLE: The rule does not apply to the resource.

  • INSUFFICIENT_DATA: No data is available.

NON_COMPLIANT

Count

integer

The number of resources that are evaluated based on the compliance result.

3

ConfigRuleArn

string

O Alibaba Cloud Resource Name (ARN) da regra.

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

ConfigRuleEvaluationStatus

object

O status de execução da regra.

FirstActivatedTimestamp

integer

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

1624932221993

FirstEvaluationStarted

boolean

Indicates whether the rule has been evaluated. Valid values:

  • true: The rule has been evaluated.

  • false: The rule has not been evaluated.

true

LastErrorCode

string

The error code returned for the last failed execution of the rule.

TimeOut

LastErrorMessage

string

The error message returned for the last failed execution of the rule.

Time out

LastFailedEvaluationTimestamp

integer

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

1614687022000

LastFailedInvocationTimestamp

integer

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

1614687022000

LastSuccessfulEvaluationTimestamp

integer

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

1624932227486

LastSuccessfulInvocationTimestamp

integer

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

1624932227476

ConfigRuleId

string

O ID da regra.

cr-7f7d626622af0041****

ConfigRuleName

string

O nome da regra.

RAM用户开启MFA

ConfigRuleState

string

O status da regra. Valores válidos:

  • ACTIVE: A regra está ativada.

  • DELETING: A regra está sendo excluída.

  • EVALUATING: A regra está sendo usada para avaliar configurações de recursos.

  • INACTIVE: A regra está desativada.

ACTIVE

ConfigRuleTriggerTypes

string

O tipo de acionamento da regra. Valores válidos:

  • ConfigurationItemChangeNotification: A regra é acionada por alterações de configuração.

  • ScheduledNotification: A regra é acionada periodicamente.

ConfigurationItemChangeNotification

CreateBy

object

As informações sobre o criador da regra.

CompliancePackId

string

The ID of the compliance package.

cp-541e626622af008****

CompliancePackName

string

The name of the compliance package.

OSS合规基线

CreatorId

string

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

100931896542****

CreatorName

string

The name of the creator.

Alice

CreateTimestamp

integer

O timestamp de quando a regra foi criada. Unidade: milissegundos.

1604684022000

Description

string

A descrição da regra.

RAM用户开启MFA,视为“合规”。

ExcludeRegionIdsScope

string

Os IDs das regiões onde a regra não se aplica. A regra não avalia recursos nessas regiões. Separe múltiplos IDs de região com vírgula (,).

cn-hangzhou

ExcludeResourceGroupIdsScope

string

Os IDs dos grupos de recursos onde a regra não se aplica. A regra não avalia recursos nesses grupos de recursos. Separe múltiplos IDs de grupo de recursos com vírgula (,).

rg-aekzdibsjjc****

ExcludeResourceIdsScope

string

Os IDs dos recursos que não são avaliados pela regra. Separe múltiplos IDs de recurso com vírgula (,).

23642660635687****

ExcludeTagsScope

array<object>

As tags dos recursos que não são avaliados pela regra.

object

As tags dos recursos que não são avaliados pela regra.

TagKey

string

The tag key.

key-2

TagValue

string

The tag value.

value-2

InputParameters

object

Os parâmetros de entrada da regra.

ManagedRule

object

Os detalhes da regra gerenciada.

CompulsoryInputParameterDetails

object

The details of the required input parameters of the managed rule.

{}

Description

string

The description of the managed rule.

ECS磁盘未因欠费或安全等原因而被锁定,视为“合规”。

Identifier

string

The identifier of the managed rule.

ram-user-mfa-check

Labels

array

The list of rule labels.

string

The label of the managed rule.

["RAM","User"]

ManagedRuleName

string

The name of the managed rule.

RAM用户开启MFA

OptionalInputParameterDetails

object

The details of the optional input parameters of the managed rule.

{}

SourceDetails

array<object>

The source details of the managed rule.

object

The source details of the managed rule.

EventSource

string

The event source.

Nota

Only Cloud Config events are supported. The value is aliyun.config.

aliyun.config

MaximumExecutionFrequency

string

The execution frequency of the rule. Valid values:

  • One_Hour: 1 hour.

  • Three_Hours: 3 hours.

  • Six_Hours: 6 hours.

  • Twelve_Hours: 12 hours.

  • TwentyFour_Hours: 24 hours.

Nota

This parameter is returned only when the rule is triggered periodically.

One_Hour

MessageType

string

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule is triggered by configuration changes.

  • ScheduledNotification: The rule is triggered periodically.

ConfigurationItemChangeNotification

MaximumExecutionFrequency

string

A frequência de execução da regra. Valores válidos:

  • One_Hour: 1 hora.

  • Three_Hours: 3 horas.

  • Six_Hours: 6 horas.

  • Twelve_Hours: 12 horas.

  • TwentyFour_Hours: 24 horas.

Nota

Este parâmetro é retornado somente quando a regra é acionada periodicamente.

One_Hour

ModifiedTimestamp

integer

O timestamp de quando a regra foi atualizada pela última vez. Unidade: milissegundos.

1614687022000

RegionIdsScope

string

Os IDs das regiões onde a regra se aplica. A regra avalia apenas recursos nessas regiões.

global

ResourceGroupIdsScope

string

Os IDs dos grupos de recursos onde a regra se aplica. A regra avalia apenas recursos nesses grupos de recursos.

rg-aekzdibsjjc****

ResourceIdsScope

string

Os IDs dos recursos que são avaliados pela regra. Separe múltiplos IDs de recurso com vírgula (,).

eip-8vbf3x310fn56ijfd****

ResourceTypesScope

string

Os tipos dos recursos que são avaliados pela regra.

ACS::RAM::User

RiskLevel

integer

O nível de risco da regra. Valores válidos:

  • 1: alto

  • 2: médio

  • 3: baixo

1

Scope

object

O escopo efetivo da regra.

ComplianceResourceTypes

array

The list of resource types that are evaluated by the rule. You can also view this information in the ResourceTypesScope field.

string

The type of the resource that is evaluated by the rule.

ACS::RAM::User

Source

object

A origem da regra.

Identifier

string

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 ARN of the function.

acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config

Owner

string

The owner of the rule. Valid values:

  • CUSTOM_FC: a custom rule.

  • ALIYUN: a managed rule.

ALIYUN

SourceDetails

array<object>

The source details.

object

The source details.

EventSource

string

The event source.

Nota

Only Cloud Config events are supported. The value is aliyun.config.

aliyun.config

MaximumExecutionFrequency

string

The execution frequency of the rule. Valid values:

  • One_Hour: 1 hour.

  • Three_Hours: 3 hours.

  • Six_Hours: 6 hours.

  • Twelve_Hours: 12 hours.

  • TwentyFour_Hours: 24 hours.

Nota

This parameter is returned only when the rule is triggered periodically.

One_Hour

MessageType

string

The trigger type of the rule. Valid values:

  • ConfigurationItemChangeNotification: The rule is triggered by configuration changes.

  • ScheduledNotification: The rule is triggered periodically.

ConfigurationItemChangeNotification

TagKeyLogicScope

string

Este parâmetro não é retornado para regras criadas usando o parâmetro TagsScope.

Este parâmetro é retornado para regras criadas usando o parâmetro obsoleto TagKeyScope. Não recomendamos que você use o parâmetro TagKeyScope. Por exemplo, se TagKeyScope estiver definido como ECS,OSS e este parâmetro estiver definido como AND, a regra se aplica apenas a recursos que possuem ambas as tags ECS e OSS.

Valores válidos:

  • AND

  • OR

OR

TagKeyScope deprecated

string

Este parâmetro está obsoleto. Use o parâmetro TagsScope em vez disso.

A regra se aplica apenas a recursos com a tag especificada.

Nota

Os parâmetros TagKeyScope e TagValueScope são retornados ao mesmo tempo.

RAM

TagValueScope deprecated

string

Este parâmetro está obsoleto. Use o parâmetro TagsScope em vez disso.

A regra se aplica apenas a recursos com a tag especificada.

Nota

Os parâmetros TagKeyScope e TagValueScope são retornados ao mesmo tempo.

MFA

TagsScope

array<object>

O escopo baseado em tags.

object

As tags que definem o escopo.

TagKey

string

The tag key.

key-1

TagValue

string

The tag value.

value-1

Tags

array<object>

As tags do recurso.

object

As tags do recurso.

TagKey

string

The tag key.

key-1

TagValue

string

The tag value.

value-1

ResourceNameScope

string

A regra avalia apenas recursos que possuem os nomes especificados.

i-xxx

ExtendContent

string

O conteúdo estendido. Este parâmetro é usado apenas para especificar o horário de acionamento para uma regra que é acionada em um ciclo de 24 horas.

{"fixedHour":"12"}

RequestId

string

O ID da solicitação.

811234F4-C3AB-4D15-B90B-F55016D1B5AA

Exemplos

Resposta de sucesso

JSON formato

{
  "ConfigRule": {
    "AccountId": 0,
    "Compliance": {
      "ComplianceType": "NON_COMPLIANT",
      "Count": 3
    },
    "ConfigRuleArn": "acs:config::100931896542****:rule/cr-7f7d626622af0041****",
    "ConfigRuleEvaluationStatus": {
      "FirstActivatedTimestamp": 1624932221993,
      "FirstEvaluationStarted": true,
      "LastErrorCode": "TimeOut",
      "LastErrorMessage": "Time out",
      "LastFailedEvaluationTimestamp": 1614687022000,
      "LastFailedInvocationTimestamp": 1614687022000,
      "LastSuccessfulEvaluationTimestamp": 1624932227486,
      "LastSuccessfulInvocationTimestamp": 1624932227476
    },
    "ConfigRuleId": "cr-7f7d626622af0041****",
    "ConfigRuleName": "RAM用户开启MFA",
    "ConfigRuleState": "ACTIVE",
    "ConfigRuleTriggerTypes": "ConfigurationItemChangeNotification",
    "CreateBy": {
      "CompliancePackId": "cp-541e626622af008****",
      "CompliancePackName": "OSS合规基线",
      "CreatorId": "100931896542****",
      "CreatorName": "Alice"
    },
    "CreateTimestamp": 1604684022000,
    "Description": "RAM用户开启MFA,视为“合规”。",
    "ExcludeRegionIdsScope": "cn-hangzhou",
    "ExcludeResourceGroupIdsScope": "rg-aekzdibsjjc****",
    "ExcludeResourceIdsScope": "23642660635687****",
    "ExcludeTagsScope": [
      {
        "TagKey": "key-2",
        "TagValue": "value-2"
      }
    ],
    "InputParameters": {
      "test": "test",
      "test2": 1
    },
    "ManagedRule": {
      "CompulsoryInputParameterDetails": {},
      "Description": "ECS磁盘未因欠费或安全等原因而被锁定,视为“合规”。",
      "Identifier": "ram-user-mfa-check",
      "Labels": [
        "[\"RAM\",\"User\"]"
      ],
      "ManagedRuleName": "RAM用户开启MFA",
      "OptionalInputParameterDetails": {},
      "SourceDetails": [
        {
          "EventSource": "aliyun.config",
          "MaximumExecutionFrequency": "One_Hour",
          "MessageType": "ConfigurationItemChangeNotification"
        }
      ]
    },
    "MaximumExecutionFrequency": "One_Hour",
    "ModifiedTimestamp": 1614687022000,
    "RegionIdsScope": "global",
    "ResourceGroupIdsScope": "rg-aekzdibsjjc****",
    "ResourceIdsScope": "eip-8vbf3x310fn56ijfd****\n",
    "ResourceTypesScope": "ACS::RAM::User",
    "RiskLevel": 1,
    "Scope": {
      "ComplianceResourceTypes": [
        "ACS::RAM::User"
      ]
    },
    "Source": {
      "Identifier": "acs:fc:cn-hangzhou:100931896542****:services/ConfigService.LATEST/functions/specific-config",
      "Owner": "ALIYUN",
      "SourceDetails": [
        {
          "EventSource": "aliyun.config",
          "MaximumExecutionFrequency": "One_Hour",
          "MessageType": "ConfigurationItemChangeNotification"
        }
      ]
    },
    "TagKeyLogicScope": "OR",
    "TagKeyScope": "RAM",
    "TagValueScope": "MFA",
    "TagsScope": [
      {
        "TagKey": "key-1",
        "TagValue": "value-1"
      }
    ],
    "Tags": [
      {
        "TagKey": "key-1",
        "TagValue": "value-1"
      }
    ],
    "ResourceNameScope": "i-xxx",
    "ExtendContent": "{\"fixedHour\":\"12\"}"
  },
  "RequestId": "811234F4-C3AB-4D15-B90B-F55016D1B5AA"
}

Códigos de erro

Código de status HTTP

Código de erro

Mensagem de erro

Descrição

400 ConfigRuleNotExists The ConfigRule does not exist. The rule does not exist.
400 NoPermission You are not authorized to perform this operation. You are not authorized to perform this operation.
404 AccountNotExisted Your account does not exist.
503 ServiceUnavailable The request has failed due to a temporary failure of the server. The request has failed due to a temporary failure of the server.

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.