# AWS Athena

AWS Athena is a serverless query engine, based on Presto, for querying data in Amazon S3.

Use this integration to build Indicators and Virtual Datasets on top of your databases defined in AWS Athena

{% tabs %}
{% tab title="Installing" %}

#### Pre-requisites:

* `git`
* `terraform-cli` (> v1.2) : detailed installation instructions [here](https://learn.hashicorp.com/tutorials/terraform/install-cli)&#x20;
* You Lariat API Key and Application Key. Contact someone on the Lariat Team to get these.

#### Download the Athena Terraform Installer

`git clone git@github.com:lariat-data/terraform-lariat-athena-agent.git`

#### &#x20;

#### Run the installation

`LARIAT_API_KEY=<your_api_key> LARIAT_APPLICATION_KEY=<your_app_key> terraform apply`
{% endtab %}

{% tab title="Configuring" %}
During installation you create a yaml config. With this config you specify the databases and tables to track as well as a unique source id to identify metrics that come from this source.&#x20;

The installer scopes permissions based on the databases selected. The installer puts the file onto your object storage and you can update this file directly to add further tables and databases and run the update command with the installer. You may use the wildcard `*` to match any table names with a chosen pattern.&#x20;

Athena-specific configuration gets stored on your s3 cloud in a lariat created bucket. The bucket should start with `lariat-athena-default-config` and end in a timestamp.&#x20;

Update this file with your chosen databases and tables to monitor, you may use the wildcard `*` to match any table names with a chosen pattern

```
databases:
  my_database_name:
    - catalog_sales_*
    - user_sessions
    - my_other_table

source_id:
  a_unique_source_id # e.g. lariat-aws-athena-us-east-1
```

{% endtab %}
{% endtabs %}


---

# 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.lariatdata.com/integrations-data-storage/aws-athena.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.
