> For the complete documentation index, see [llms.txt](https://docs.telm.ai/telmai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.telm.ai/telmai/connect-to-data/data-connections/aws-athena.md).

# AWS Athena

## Creating a connection

Before connecting to AWS Athena, ensure that the IAM user, whose credentials will be used, has the following permissions granted:

**Athena Permissions**

```
athena:StartQueryExecution
athena:GetQueryExecution
athena:GetQueryResults
athena:StartQueryExecution
athena:GetWorkGroup
athena:StopQueryExecution
athena:CreatePreparedStatement
athena:UpdatePreparedStatement
athena:GetPreparedStatement
athena:DeletePreparedStatement
s3:ListBucket
s3:GetObject
s3:PutObject
s3:GetBucketLocation
s3:GetObject
s3:ListBucket
s3:PutObject
s3:ListMultipartUploadParts
s3:AbortMultipartUpload
glue:GetDatabase,
glue:GetDatabases,
glue:CreateDatabase
glue:CreateTable
glue:GetTable
glue:GetTables
```

**S3 Permissions:**

```
s3:ListBucket
s3:GetObject
s3:PutObject
s3:GetBucketLocation
s3:GetObject
s3:ListBucket
s3:PutObject
s3:ListMultipartUploadParts
s3:AbortMultipartUpload
```

**Glue Permissions:**

```
glue:GetDatabase,
glue:GetDatabases,
glue:CreateDatabase
glue:CreateTable
glue:GetTable
glue:GetTables
```

Once permissions are defined, you can setup the connection by defining:

* **AWS** **Key**
* **AWS** **Secret**
* **Database**
* **Region**
* **S3 Staging Directory**

<figure><img src="/files/3MC1wg818KsG0mJ8Zsq6" alt=""><figcaption></figcaption></figure>

## Connecting an asset

Once a connection is defined, you can start using it to create assets. To create assets, you will need to select existing table or run a custom SQL query.

<figure><img src="/files/g256v2M1E1Dq73EWxFVK" alt=""><figcaption></figcaption></figure>
