

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

# 需要額外許可 [V2] 的日誌記錄
<a name="AWS-vended-logs-permissions-V2"></a>

有些 AWS 服務使用新方法來傳送其日誌。這是一種靈活的方法，可讓您設定從這些服務到下列一或多個目的地的日誌交付：CloudWatch Logs、Amazon S3 或 Firehose 和 X-Ray 以進行追蹤交付。

工作日誌交付包含三個元素：
+ `DeliverySource`（一種） 是邏輯物件，代表實際傳送日誌的資源。
+ `DeliveryDestination`，這是代表實際交付目的地的邏輯物件。
+ `Delivery`將交付來源連線至交付目的地的

若要設定支援 AWS 的服務與目的地之間的日誌交付，您必須執行下列動作：
+ 使用 [PutDeliverySource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) 建立交付來源。
+ 使用 [PutDeliveryDestination](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html) 建立交付目的地。
+ 如果您要跨帳戶交付日誌，則必須在目的地帳戶中使用 [ PutDeliveryDestinationPolicy](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html)，將 IAM 政策指派給目的地。此政策授權從帳戶 A 中的交付來源建立交付至帳戶 B 中的交付目的地。對於跨帳戶交付，您必須自行手動建立許可政策。
+ 使用 [ CreateDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html)。

以下各節提供您在登入後使用 V2 處理程序設定每種目的地的日誌傳遞所需之許可的詳細資訊。可將這些許可授予您登入時具有的 IAM 角色。

**重要**  
刪除日誌產生資源後，您有責任移除日誌交付資源。若要這樣做，請遵循下列步驟。  
`Delivery` 使用 [DeleteDelivery](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteDelivery.html) 操作刪除 。
`DeliverySource` 使用 [DeleteDeliverySource](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteDeliverySource.html) 操作刪除 。
如果與您剛刪除`DeliverySource`的 `DeliveryDestination`相關聯的 僅用於此特定 `DeliverySource`，則您可以使用 [DeleteDeliveryDestinations](https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveryDestinations.html) 操作將其移除。

**Contents**
+ [傳送至 CloudWatch Logs 的日誌](AWS-logs-infrastructure-V2-CloudWatchLogs.md)
+ [傳送至 Amazon S3 的日誌](AWS-logs-infrastructure-V2-S3.md)
  + [Amazon S3](AWS-logs-infrastructure-V2-S3.md#AWS-logs-SSE-KMS-S3-V2)
+ [傳送至 Firehose 的日誌](AWS-logs-infrastructure-V2-Firehose.md)
+ [傳送至 X-Ray 的追蹤](AWS-logs-infrastructure-V2-XRayTraces.md)