> For the complete documentation index, see [llms.txt](https://olddocs.exivity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://olddocs.exivity.io/getting-started/tutorials/amazon-aws-cur.md).

# Amazon AWS CUR

## Prerequisites

This tutorial assumes that you have CUR (Cost and Usage Report) set up in your AWS environment. If this is not the case please follow the steps in [Turning on the AWS Cost and Usage Report](https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-reports-gettingstarted-turnonreports.html) before proceeding.

Please note that we also need the following requisites:

* S3 bucket where the CUR reports are placed
* The AWS region of the S3 bucket
* The path where the reports are placed inside the S3 bucket

To get these requirements you can go to the Amazon S3 service - Buckets and note the name and the region of our CUR S3 bucket.

![](/files/-Lq5ikcXyGaWCoOkemzV)

Once inside the CUR bucket, you must find the path where the monthly reports reside, please navigate the bucket until you find a folder like this one and note the path:

![In this case, cur is the path of the report (exivity\_cur\_report is the name of the report itself)](/files/-Lq5jTKlcjHJ_ShSAjys)

## Obtaining the API Credentials

We have to create an IAM User that has read access to the CUR bucket. Please follow these steps:

* Go to **IAM** - **Policies** and click on **Create policy.**

![](/files/-Lq5lRZHORS6itaSxziR)

* In the next screen:&#x20;  **Service** select *S3*, **Actions** select *Read*, **Resources** select Specific and in **bucket** click on *Add ARN.*

![](/files/-Lq5muZmOq9wG39GXc1S)

* In the next screen, type the name of your bucket followed by */\** in **Bucket name** (example: *billing-bucket/\**) and click on *Add.*
* Click on **Review Policy.**
* Give a **Name** and a **Description** to the policy and finally click on **Create policy.**

Now, we will attach the policy to a user:

* Go to **IAM** – **Users** – **Add user.**

![](/files/-Lq5noPAD3-OlKODIiXB)

* Add a **User name** and select **Access type**: *Programmatic access*.

![](/files/-Lq5o3tYGPWCN6Gs7_QO)

* Click on **Attach existing Policies directly** and filter by the name of the policy you just created.
* Select the policy and click on **Next:Tags.**
* Add a Key-Value pair for the Tags and click on **Next:Review.**
* Click on **Create User.**
* On the next screen click on **Download .csv** we will use these credentials to populate our Exivity Extractor in the next section.
* Finally, click on **Close.**

## Configure Extractor

To create the Extractor in Exivity, browse to **Data Sources > Extractors** and click the *Create Extractor* button. This will try to connect to the Exivity Github account to obtain a list of available templates. For AWS, please click *AWS\_CUR\_Extractor* from the list. Provide a name for the Extractor in the name field, and click the **Create** button.

![](/files/-Lq5p7tM0RVUToBy4hgr)

Once you have created the Extractor, go to the first tab: **Variables**

* **Bucket:** Type the name of your S3 CUR bucket.
* **AWS region:** The name of your S3 CUR bucket region code can be found in the [Regions, Availability Zones, and Local Zones Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html) (Region column).
* **Access key:** You can find it in the **csv** that you have downloaded in the previous section.
* **Secret key:** You can find it in the **csv** that you have downloaded in the previous section.
* **Cur report:** Type the name of your CUR report.
* **Bucket Directory**: Type the path that you got in the previous section (if there is more than one folder separate them with /).

![](/files/-Lq5uB4OxhYzUhedWErO)

Once you have filled in all details, go to the **Run** tab to execute the Extractor for a single day:

![](/files/-Lq5ra80t0VubZE4RdSQ)

The Extractor requires one parameter in *yyyMMdd* format:

* **from\_date** is the date for which you wish to collect consumption data.

When you click the **Run Now** button, you should get a successful result.

## Configure Transformer

Once you have successfully run your AWS CUR Extractor, you should be able to create a Transformer template via **Data Sources > Transformers** and click the **Create Transformer** button. Select the AWS CUR Transformer and run it for a single day as a test. Make sure that it is the same day as for which you extracted consumption data in the previous step.

## Create Report

Once you have run both your Extractor and Transformer successfully create a Report Definition via the menu option **Report Definition** via the menu **Reports > Definitions**:

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LMg6h46PYa2zRIM4aIw%2F-LMgRgI97NEbU5KopHCw%2FManual12.jpg?alt=media\&token=6dfff1dd-341d-4a1f-bcbf-3d66290f3fd9)

Select the column(s) by which you would like to break down the costs. Once you have created the report, you should then click the **Prepare Report** button after first making sure you have selected a valid date selector shown when preparing the report.![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LHEKskLK6aXinV75Knl%2F-LMg6h46PYa2zRIM4aIw%2F-LMgS-sUs8uBd0jk5bFC%2FManual13.jpg?alt=media\&token=3fd1f372-60bc-48f3-a339-bbcc0f0d0086)

Once this is done you should be able to run any of the **Accounts**, **Instances**, **Services** or **Invoices** report types located under the *Report* menu for the date range you prepared the report for.
