> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Amazon Athena

> Connect Amazon Athena to Paradime to run dbt™ against your S3 data lake from the Code IDE, schedule Bolt jobs, and use Agent sessions.

[Amazon Athena](https://aws.amazon.com/athena/) is a serverless query service that makes it easy to analyze data stored in Amazon S3. Connect it to Paradime to develop dbt™ from the Code IDE, deploy production jobs with Bolt, and let the DinoAI background agent run dbt™ models and queries during background sessions.

<Warning>
  **IP restrictions**

  Make sure to allow traffic from one of the Paradime IPs in your firewall depending on the data location selected.

  See also: [Paradime IP addresses](/developers/ip-restrictions).
</Warning>

<Note>
  **Available in:** Code IDE, Bolt, and Agent environments.
</Note>

## Add a connection

1. Click **Settings** in the top menu bar of the Paradime interface to access **Workspace Settings**.
2. In the left sidebar, click **Environments**.
3. Click **Add New** next to the section for the environment you are configuring:
   * **Code IDE** for the Code IDE connection
   * **Bolt** for the Bolt connection
   * **Agent** for the Agent connection
4. Select **Amazon Athena**.
5. In the **Profile Configuration** field, add at least the required parameters. For additional options, see [Profile fields reference](#profile-fields-reference).
6. Provide a dbt™ **Profile Name**. This should match the profile name set in your `dbt_project.yml`.
7. In the **Target** field, enter `dev` for Code IDE, `prod` for Bolt, or `dinoai` for the Agent environment.
8. The **Schema** field is pre-configured, but you can change it to specify the schema where dbt™ will build objects.
9. The **Threads** value is pre-configured to 1, but you can adjust this to specify how many parallel operations your dbt™ project can run.

<Info>
  After adding the configuration, ensure it's properly formatted using a YAML formatter like [YAML Formatter](https://jsonformatter.org/yaml-formatter).
</Info>

## Profile configuration

```yaml theme={"system"}
s3_staging_dir: s3://analytics-staging/athena/query-results/   # Store query results
s3_data_dir: s3://analytics-data/raw/                          # Raw data location
s3_data_naming: table_unique                                   # Unique table naming
region_name: us-west-2                                         # AWS region
database: analytics_prod                                       # Production database
num_retries: 3                                                 # Query retry attempts
```

<Info>
  **Important notes**

  * All S3 paths should end with a forward slash (`/`).
  * AWS credentials can be configured through environment variables, AWS credentials file, or IAM roles.
</Info>

## Profile fields reference

| Field              | Description                                                                     | Example                          | Default | Required |
| ------------------ | ------------------------------------------------------------------------------- | -------------------------------- | ------- | -------- |
| s3\_staging\_dir   | S3 bucket location where Athena will store query results                        | `s3://my-bucket/athena/staging/` | None    | ✅        |
| s3\_data\_dir      | S3 bucket location where Athena will store table data                           | `s3://my-bucket/athena/data/`    | None    | ✅        |
| s3\_data\_naming   | Naming convention used when writing to S3                                       | `table_unique`                   | None    | ❌        |
| region\_name       | AWS region where your Athena instance is located                                | `us-east-1`                      | None    | ✅        |
| database           | Name of the Athena database to connect to                                       | `analytics_db`                   | None    | ✅        |
| schema             | Default schema where dbt™ will build objects. Configured in the UI Schema field | `reporting`                      | None    | ✅        |
| aws\_profile\_name | Profile name from your AWS shared credentials file                              | `default`                        | None    | ❌        |
| threads            | Number of concurrent operations. Configured in the UI Threads field             | `4`                              | `1`     | ❌        |
| num\_retries       | Number of times to retry a failed query before failing                          | `3`                              | `5`     | ❌        |

## Related

<CardGroup cols={2}>
  <Card title="Optional connection attributes" href="/guides/data-warehouse-essentials/optional-connection-attributes" icon="gear" horizontal>
    Set additional `profiles.yml` attributes for this connection.
  </Card>
</CardGroup>


## Related topics

- [Bolt environment](/products/settings/connections/scheduler-environment/index.md)
- [Agent environment](/products/settings/connections/dinoai-background-agent-environment/index.md)
- [Code IDE environment](/products/settings/connections/development-environment/index.md)
- [Amazon Quick](/products/dino-ai/mcp-server/amazon-quick.md)
- [Amazon S3](/integrations/amazon-s3.md)
