

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

# 記錄可設定的 AD 同步錯誤
<a name="logging-ad-sync-errors"></a>

您可以在可設定的 Active Directory (AD) 同步組態上啟用記錄，以接收包含同步程序期間可能發生之錯誤相關資訊的日誌。透過這些日誌，您可以監控可設定的 AD 同步是否存在問題，並在適用時採取動作。您可以將日誌傳送至 Amazon CloudWatch Logs 日誌群組、Amazon Simple Storage Service (Amazon S3) 儲存貯體，或支援 Amazon S3 儲存貯體和 Firehose 跨帳戶交付的 Amazon Data Firehose。

如需限制、許可和付費日誌的詳細資訊，請參閱[啟用記錄來源 AWS 服務](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html)。

**注意**  
您需要支付記錄費用。如需詳細資訊，請參閱 [Amazon CloudWatch 定價](https://aws.amazon.com/cloudwatch/pricing/)頁面上的[已修訂日誌](https://aws.amazon.com/cloudwatch/pricing/#Vended_Logs)。

## 啟用可設定的 AD 同步錯誤日誌
<a name="enable-logging-ad-sync-errors"></a>

1. 登入 [IAM Identity Center 主控台](https://console.aws.amazon.com/singlesignon/)。

1. 選擇**設定**。

1. 在**設定**頁面上，選擇**身分來源**索引標籤，選擇**動作**，然後選擇**管理日誌**。

1. 選擇**新增日誌交付**和下列其中一個目的地類型。

   1. 選擇**至 Amazon CloudWatch Logs**。然後選擇或輸入目的地日誌群組。

   1. 選擇**至 Amazon S3**。然後選擇或輸入目的地儲存貯體。

   1. 選擇**至 Firehose**。然後選擇或輸入目的地交付串流。

1. 選擇**提交**。

## 停用可設定的 AD 同步錯誤日誌
<a name="disable-logging-ad-sync-errors"></a>

1. 登入 [IAM Identity Center 主控台](https://console.aws.amazon.com/singlesignon/)。

1. 選擇**設定**。

1. 在**設定**頁面上，選擇**身分來源**索引標籤，選擇**動作**，然後選擇**管理日誌**。

1. 針對您要**移除**的目的地選擇移除。

1. 選擇**提交**。

## 可設定的 AD 同步錯誤日誌欄位
<a name="logging-ad-sync-errors-fields"></a>

如需可能的錯誤日誌欄位，請參閱下列清單。

`sync_profile_name`  
同步設定檔的名稱。

`error_code`  
代表已發生之錯誤類型的錯誤代碼。

`error_message`  
包含所發生錯誤之詳細資訊的訊息。

`sync_source`  
同步來源是實體同步的來源。對於 IAM Identity Center，這是由 管理的 Active Directory (AD) Directory Service。同步來源包含受影響目錄的網域和 ARN。

`sync_target`  
同步目標是儲存實體的目的地。對於 IAM Identity Center，這是 Identity Store。同步目標包含受影響的 Identity Store ARN。

`source_entity_id`  
造成錯誤的實體的唯一識別符。對於 IAM Identity Center，這是實體的 SID。

`source_entity_type`  
造成錯誤的實體類型。此值可以為 `USER` 或 `GROUP`。

`eventTimestamp`  
發生錯誤時的時間戳記。

## 可設定的 AD 同步錯誤日誌範例
<a name="logging-ad-sync-errors-examples"></a>

**範例 1：AD 目錄過期密碼的錯誤日誌**

```
{
    "sync_profile_name": "EXAMPLE-PROFILE-NAME",
    "error" : {
        "error_code": "InvalidDirectoryCredentials", 
        "error_message": "The password for your AD directory has expired. Please reset the password to allow Identity Sync to access the directory." 
    },
    "sync_source": {
        "arn": "arn:aws:ds:us-east-1:123456789:directory/d-123456",
        "domain": "EXAMPLE.com" 
    },
    "eventTimestamp": "1683355579981"
}
```

**範例 2：具有非唯一使用者名稱之使用者的錯誤日誌**

```
{
    "sync_profile_name": "EXAMPLE-PROFILE-NAME",
    "error" : {
        "error_code": "ConflictError", 
        "error_message": "The source entity has a username conflict with the sync target. Please verify that the source identity has a unique username in the target." 
    },
    "sync_source": {
        "arn": "arn:aws:ds:us-east-1:111122223333:directory/d-123456",
        "domain": "EXAMPLE.com"
    },
    "sync_target": {
        "arn": "arn:aws:identitystore::111122223333:identitystore/d-123456" 
    },
    "source_entity_id": "SID-1234",
    "source_entity_type": "USER",
    "eventTimestamp": "1683355579981"
}
```