# 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 ](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode).

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](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql) compatible\
\
**November 2024**\
\- This connector supports [hybrid pipelines ](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/hybrid-pipeline)\\

**July 25**\
\- This data connector is supported for connection and [NativeSQL](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/youprep-tm-native-sql) 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 [..](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/setting-up-a-connector "mention"), 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](https://docs-v3.toucantoco.com/data-management-in-datahub/datasources-in-toucan/managing-connectors/create-a-dataset-from-a-connector/code-mode-and-single-mode) 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 [creating-datasets](https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/managing-datasets/creating-datasets "mention")
{% endhint %}

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