# AWS

#### Pre-requisite: AWS Account Access

Costtrail.io requires secure, read-only access to your AWS accounts to generate the analysis and reports you need. Please log in to your AWS console to get started. We’ve made the setup process straightforward, ensuring compliance with AWS security best practices.

**Note:** If you need any assistance, feel free to schedule a meeting with us, and we’ll guide you through the process step by step.

#### Steps to Set Up an S3 Billing Bucket for Cost & Usage Reports (CUR)

**Step 1: Create the Cost & Usage Report (CUR)**

To allow Costtrail.io to analyze your cost data, you'll need to create a Cost & Usage Report (also known as Detailed Billing Reports or CUR).

1. **Log in** to your AWS Management Console.
2. **Navigate** to the **Billing & Cost Management Dashboard**.
3. On the left-hand side, under **Cost Analysis - Click on Data Exports**.
4. Click **Create Report**.
5. Enter a **Report Name** (e.g., `costtrailbilling-daily-gzip`).
6. In **Additional Report Details**, check the box for **Include resource IDs** (mandatory).
7. Under **Data Refresh Settings**, check the box for **Automatically refresh your Cost & Usage Report when charges are detected for previous months with closed bills**.
8. Click **Next** to proceed to the Delivery Options page where you will set up the S3 billing bucket.

**Step 2: Create or Select an S3 Billing Bucket**

Now, you’ll configure an S3 bucket to securely store your cost and usage data.

1. On the **Delivery Options** page, click **Configure**. This will open the S3 bucket configuration dialog.
2. In the dialog box, you can either:
   * **Select an existing bucket** from your AWS account, or
   * **Create a new bucket** specifically for Costtrail.io.
3. Once selected, click **Next** to go to the **Verify Policy** section.
4. Check the box confirming that "I have confirmed that this policy is correct."
5. Click **Save**. This will bring you back to the Delivery Options page.
6. On the **Delivery Options** page, click **Verify** to ensure that the S3 bucket policy is correct for delivering reports.
7. Enter a **Report Path Prefix** (e.g., `costtrailbilling`).
8. Select **Daily** for **Time Granularity** (mandatory).
9. Choose your preferred **Report Versioning** option (suggestion: **Overwrite existing report**).
10. Select **GZIP** as the **Compression Type** (mandatory).
11. Click **Next**, then **Review and Complete**.
12. Copy and paste the **Bucket Name**, **Report Name**, and **Prefix Path** into the Costtrail.io integration page.

**Step 3: Create an IAM Role**

Next, you’ll create an IAM role to grant Costtrail.io secure, read-only access.

1. Go to the **IAM** service in your AWS console.
2. Select **Roles** and click **Create Role**.
3. Under **Select Trusted Entity**, choose **Another AWS account**.
4. Copy and paste this AWS Account ID: `651706742966`.
5. Check the box for **Require External ID** and copy-paste this external ID: `136102`.
6. Select the policy titled **ReadOnlyAccess** and check the box next to it.
7. Click **Next: Tags**, then click **Next: Review**.
8. Enter a **Role Name** (e.g., `CostTrailViewRole`), and click **Create Role**.
9. Once the role is created, click on it to view the details.
10. Copy the **Role ARN** and paste it into the Costtrail.io integrations page.


---

# 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://docs.costtrail.io/aws.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.
