

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 验证 AWS Config 是否已成功启动 AWS CLI
<a name="gs-cli-verify-subscribe"></a>

启动后 AWS Config，您可以使用 AWS CLI 命令检查是否 AWS Config 正在运行以及是否 AWS Config 已创建配置记录器和传送渠道。您也可以确认 AWS Config 已开始录制配置并将其传送到交付渠道。

**Topics**
+ [步骤 1：检查是否已创建传输通道](#gs-cli-verify-channel)
+ [步骤 2：检查是否已创建配置记录器](#gs-cli-verify-recorder)
+ [第 3 步：检查是否 AWS Config 已开始录制](#gs-cli-verify-config-recording)

## 步骤 1：检查是否已创建传输通道
<a name="gs-cli-verify-channel"></a>

使用 [https://docs.aws.amazon.com/cli/latest/reference/configservice/describe-delivery-channels.html](https://docs.aws.amazon.com/cli/latest/reference/configservice/describe-delivery-channels.html) 命令检查是否已配置 Amazon S3 存储桶和 Amazon SNS 主题。

您可以使用 `--delivery-channel-names` 字段来指定传输通道列表。如果未指定传输通道，则此命令将返回与该账户关联的所有传输通道的详细信息。

```
$ aws configservice describe-delivery-channels
{
    "DeliveryChannels": [
        {
            "snsTopicARN": "arn:aws:sns:us-west-2:0123456789012:my-config-topic",
            "name": "my-delivery-channel",
            "s3BucketName": "my-config-bucket"
        }
    ]
}
```

## 步骤 2：检查是否已创建配置记录器
<a name="gs-cli-verify-recorder"></a>

使用 [https://docs.aws.amazon.com/cli/latest/reference/configservice/describe-configuration-recorders.html](https://docs.aws.amazon.com/cli/latest/reference/configservice/describe-configuration-recorders.html) 命令检查配置记录器是否已创建。

您可以使用 `arn` 和 `configuration-recorder-names` 字段来指定配置记录器列表。如果未指定配置记录器，则此命令将返回与该账户关联的所有配置记录器的详细信息。

```
$ aws configservice describe-configuration-recorders
{
    "ConfigurationRecorders": [
        {
            "roleARN": "arn:aws:iam::012345678912:role/myConfigRole",
            "name": "default"
        }
    ]
}
```

## 第 3 步：检查是否 AWS Config 已开始录制
<a name="gs-cli-verify-config-recording"></a>

使用 [https://docs.aws.amazon.com/cli/latest/reference/configservice/describe-configuration-recorder-status.html](https://docs.aws.amazon.com/cli/latest/reference/configservice/describe-configuration-recorder-status.html) 命令检查配置记录器是否成功记录了范围内的资源类型。

您可以使用 `arn` 和 `configuration-recorder-names` 字段来指定配置记录器列表。如果未指定配置记录器，则此命令将返回与该账户关联的所有配置记录器的详细信息。

```
$ aws configservice describe-configuration-recorder-status
{
    "ConfigurationRecordersStatus": [
        {
            "name": "default",
            "lastStatus": "SUCCESS",
            "lastStopTime": 1414511624.914,
            "lastStartTime": 1414708460.276,
            "recording": true,
            "lastStatusChangeTime": 1414816537.148,
            "lastErrorMessage": "NA",
            "lastErrorCode": "400"
        }
    ]
}
```

`recording` 字段中的 `true` 值用于确认配置记录器已开始记录配置。 AWS Config 采用 UTC 格式来记录时间。输出显示为 Unix 时间戳。