# Add an AWS Athena connector

## Connector features

You can use the Toucan AWS Athena connector to connect to your AWS Athena account with a AWS Access key and AWS secret access key and access `tables` with a SQL query or by [using our no-code form ](/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode.md).

With this connection, you can fetch data from your AWS Athena account to fill your charts and dashboards.

{% hint style="info" %}
**Changelog**

**December 23**\
\- this connector is [NativeSQL](/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql.md) compatible\
\
**November 2024**\
\- This connector supports [hybrid pipelines ](/data-management-in-datahub/datasets-in-toucan/preparing-data/hybrid-pipeline.md)\\

**July 25**\
\- This data connector is supported for connection and [NativeSQL](/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql.md) by our [new Data Execution system](https://www.toucantoco.com/en/blog/multi-tenant-architecture)
{% endhint %}

## Configuring an AWS Athena connection

Follow the steps described in [Add a connector](/data-management-in-datahub/datasources-in-toucan/managing-connectors/setting-up-a-connector.md), choose `AWS Athena` and fill out the form with the following info:

<table><thead><tr><th width="171.7421875">Field</th><th width="140.01953125">Format / Type</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td>Name (mandatory)</td><td>String</td><td>Use it to identify your connection</td><td><em>MyAthenaConnection</em></td></tr><tr><td>S3 Output Bucket (mandatory)</td><td>String</td><td>the S3 bucket and prefix where results from your queries will be saved</td><td><em>s3://mybucket/athena-queries</em></td></tr><tr><td>AWS Access Key Id (mandatory)</td><td>String</td><td>the ID of the the AWS access key that will be used to connect to Athena.</td><td><em>AKIAIOSFODNN7EXAMPLE</em></td></tr><tr><td>AWS Secret Access Key (mandatory)</td><td>String</td><td>the AWS secret access key that will be used to connect to Athena. (will be stored as a secret)</td><td><em>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</em></td></tr><tr><td>Region Name (mandatory)</td><td>String</td><td>the name of the AWS region you need to query.</td><td><em>eu-west-3</em></td></tr><tr><td>Retry Policy (optional)</td><td>Boolean</td><td><p><em>Boolean</em> allows to configure a retry policy if the connection is flaky.</p><ul><li>max attempts: maximum number of retries before giving up</li><li>max_delay: in seconds, above the connection is dropped</li><li>wait_time: time in seconds between each retry</li></ul></td><td></td></tr><tr><td>Slow Queries' Cache Expiration Time (optional)</td><td>Integer</td><td>Slow queries' cache expiration time in seconds</td><td></td></tr></tbody></table>

Click on the `TEST CONNECTION` button then `SAVE` the connection

{% hint style="success" %}
After successfully configuring the connector, you will be able to find it in the Connector section of the DataHub "Datasource" tab
{% endhint %}

{% hint style="info" %}
Depending on your rights, you will have the “Can list databases” checked or not, but note that this doesn’t prevent you to be able to use the connector itself.
{% endhint %}

## Create a dataset from an AWS Athena connection

{% hint style="info" %}
This data connector is supported in [simple and code/SQL mode](/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode.md) for our current Data Execution system and new Data Execution systems
{% endhint %}

To create a dataset from AWS Athena, click on the "create from icon", you will then be able to:

* Select the `Database`
* Select a `table`
* Add a Query (optional): you can query using the SQL syntax accepted by Athena

{% hint style="info" %}
For more info, see the dedicated section [Create a new dataset from a dataset](/data-management-in-datahub/datasets-in-toucan/managing-datasets/creating-datasets.md)
{% endhint %}

{% hint style="success" %}
After selecting data from your connector you will be able to create a dataset thanks to [YouPrep](/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm.md) using the selection as "source step".
{% endhint %}


---

# 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-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/setting-up-a-connector/database-and-data-warehouse-connectors/setting-up-an-aws-athena-connector.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.
