# Have CloudTrail deliver log files from multiple AWS accounts into a Single S3 bucket

* You can **have CloudTrail deliver log files from multiple AWS accounts into a single S3 bucket**.<br>

* For example, you have **four AWS accounts with account IDs 111111111111, 222222222222, 333333333333, and 444444444444**, and you want to **configure CloudTrail to deliver log files from all four of these accounts to a bucket belonging to account 111111111111:**

  1. **Turn on CloudTrail in the account where the destination bucket will belong** (111111111111 in this example).
  2. **Update the bucket policy on your destination bucket to grant cross-account permissions** to CloudTrail.
  3. **Turn on CloudTrail in the other accounts you want (222222222222, 333333333333, and 444444444444 in this example)**.
  4. **Configure CloudTrail in these accounts to use the same bucket belonging to the account that you specified in step 1** (111111111111 in this example).

* The **Log File Prefix is just optional and doesn't need to be identical to the name of the S3 bucket**.<br>

* **Ensure that each trail is active using the CloudTrail console** and **verify that the specified destination S3 bucket name is correctly configured**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://karansingh.gitbook.io/tutorialsdojo-wrong-answers-aws-sec-spec/review-mode-test-1-93/have-cloudtrail-deliver-log-files-from-multiple-aws-accounts-into-a-single-s3-bucket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
