檢視組態錄製程式 - AWS Config

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

檢視組態錄製程式

您必須使用 AWS CLI 來檢視有關組態錄製程式的詳細資料。

下列程式碼範例會示範如何使用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" } ] }
PowerShell
適用的工具 PowerShell

範例 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

下列程式碼範例會示範如何使用DescribeConfigurationRecorderStatus

CLI
AWS CLI

取得組態錄製程式的狀態資訊

下列命令會傳回預設組態記錄程式的狀態:

aws configservice describe-configuration-recorder-status

輸出:

{ "ConfigurationRecordersStatus": [ { "name": "default", "lastStatus": "SUCCESS", "recording": true, "lastStatusChangeTime": 1452193834.344, "lastStartTime": 1441039997.819, "lastStopTime": 1441039992.835 } ] }
PowerShell
適用的工具 PowerShell

範例 1:此範例會傳回組態記錄器的狀態。

Get-CFGConfigurationRecorderStatus

輸出:

LastErrorCode : LastErrorMessage : LastStartTime : 10/11/2019 10:13:51 AM LastStatus : Success LastStatusChangeTime : 12/31/2019 6:14:12 AM LastStopTime : 10/11/2019 10:13:46 AM Name : default Recording : True