

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

# 使用 Amazon EventBridge 監控事件
<a name="events"></a>

Amazon EventBridge 事件描述 DataSync 資源中的變更。您可以設定規則來比對這些事件，並將這些事件路由到一或多個目標函數或串流。盡可能發出事件。

## DataSync 傳輸事件
<a name="events-transfer"></a>

下列 EventBridge 事件可用於 DataSync 傳輸。


| **Agent state changes** | 
| --- |
| 事件 | Description | 
| Online | The agent is configured properly and ready to use. This is the normal running status for an agent. | 
| Offline | The agent has been out of contact with the DataSync service for five minutes or longer. This can happen for a few reasons. For more information, see [如果我的客服人員離線，該怎麼辦？](troubleshooting-datasync-agents.md#troubleshoot-agent-offline) | 
| **Location state changes** | 
| --- |
| 事件 | Description | 
| Adding | DataSync is adding a location. | 
| Available | The location is created and is available to use. | 
| **Task state changes** | 
| --- |
| 事件 | Description | 
| Available | The task was created and is ready to start. | 
| Running | The task is in progress and functioning properly.  | 
| Unavailable | The task isn't configured properly and can't be used. You might see this event when an agent associated with the task goes offline.  | 
| Queued | Another task is running and using the same agent. DataSync runs tasks in series (first in, first out).  | 
| **Task execution state changes** | 
| --- |
| 事件 | Description | 
| Queueing | Another task execution is running and using the same DataSync agent. For more information, see [了解您的任務何時排入佇列](run-task.md#queue-task-execution). | 
| Launching | DataSync is initializing the task execution. This status usually goes quickly but can take up to a few minutes. | 
| Preparing |  DataSync 正在決定要傳輸哪些資料。 此步驟可能需要幾分鐘或幾小時的時間，取決於兩個位置的檔案、物件或目錄數量，以及設定任務的方式。準備可能也不適用於您的任務。如需詳細資訊，請參閱[DataSync 如何準備資料傳輸](how-datasync-transfer-works.md#how-datasync-prepares)。  | 
| Transferring |  DataSync is performing the actual data transfer. | 
| Verifying | DataSync is performing a data-integrity check at the end of the transfer. | 
| Success | The task execution succeeded. | 
| Cancelling | The task execution is in the process of being cancelled. | 
| Error | The task execution failed. | 