

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 驗證 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 時間戳記。