

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

# 搭配使用 `DescribeConfigurationRecorders` 與 CLI
<a name="example_config-service_DescribeConfigurationRecorders_section"></a>

下列程式碼範例示範如何使用 `DescribeConfigurationRecorders`。

------
#### [ CLI ]

**AWS CLI**  
**取得組態記錄器的詳細資訊**  
下列命令會傳回預設組態記錄器的詳細資訊：  

```
aws configservice describe-configuration-recorders
```
輸出：  

```
{
    "ConfigurationRecorders": [
        {
            "recordingGroup": {
                "allSupported": true,
                "resourceTypes": [],
                "includeGlobalResourceTypes": true
            },
            "roleARN": "arn:aws:iam::123456789012:role/config-ConfigRole-A1B2C3D4E5F6",
            "name": "default"
        }
    ]
}
```
+  如需 API 詳細資訊，請參閱《AWS CLI 命令參考》**中的 [DescribeConfigurationRecorders](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configservice/describe-configuration-recorders.html)。

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**範例 1：此範例傳回組態記錄器的詳細資訊。**  

```
Get-CFGConfigurationRecorder | Format-List
```
**輸出：**  

```
Name           : default
RecordingGroup : Amazon.ConfigService.Model.RecordingGroup
RoleARN        : arn:aws:iam::123456789012:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V4)》**中的 [DescribeConfigurationRecorders](https://docs.aws.amazon.com/powershell/v4/reference)。

**Tools for PowerShell V5**  
**範例 1：此範例傳回組態記錄器的詳細資訊。**  

```
Get-CFGConfigurationRecorder | Format-List
```
**輸出：**  

```
Name           : default
RecordingGroup : Amazon.ConfigService.Model.RecordingGroup
RoleARN        : arn:aws:iam::123456789012:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig
```
+  如需 API 詳細資訊，請參閱《AWS Tools for PowerShell Cmdlet 參考 (V5)》**中的 [DescribeConfigurationRecorders](https://docs.aws.amazon.com/powershell/v5/reference)。

------

如需 AWS SDK 開發人員指南和程式碼範例的完整清單，請參閱 [AWS Config搭配AWS SDK 使用](sdk-general-information-section.md)。此主題也包含有關入門的資訊和舊版 SDK 的詳細資訊。