
## Crawl Amazon Athena

URL: https://docs.atlan.com/apps/connectors/database/amazon-athena/how-tos/crawl-amazon-athena

> To crawl metadata from Amazon Athena, review the [order of operations](/product/connections/how-tos/order-workflows) and then complete the following steps.

Once you have configured the [Amazon Athena access permissions](https://docs.atlan.com/llms/connectors/amazon-athena/set-up-amazon-athena/llms.txt), you can establish a connection between Atlan and Amazon Athena. (If you are also using a private network for Amazon Athena, you need to [set that up first](https://docs.atlan.com/llms/connectors/amazon-athena/set-up-a-private-network-link-to-amazon-athena/llms.txt), too.)

To crawl metadata from Amazon Athena, review the [order of operations](https://docs.atlan.com/llms/catalog/connector-capabilities/order-workflows/llms.txt) and then complete the following steps.

## Select the source

To select Amazon Athena as your source:

1. In your Atlan workspace, click **Connectors** in the left sidebar.
 * If you are using the **Old UI (Classic)**, click **New Workflow** in the top navigation.

2. Click **Marketplace**.

3. Search for **Athena Assets** and select it.

4. Click **Install**.

5. Once installation completes, click **Setup Workflow** on the same tile.

## Provide credentials

To enter your Amazon Athena credentials:

1. For _Host_ enter the host name (or [PrivateLink endpoint](https://docs.atlan.com/llms/connectors/amazon-athena/set-up-a-private-network-link-to-amazon-athena/llms.txt)) for your Amazon Athena instance.

2. For _Authentication_ choose the method you configured when [setting up the Amazon Athena access permissions](https://docs.atlan.com/llms/connectors/amazon-athena/set-up-amazon-athena/llms.txt):
 - At the bottom, enter the _AWS Role ARN_ and _S3 Output Location_ you configured. The _S3 Output Location_ is where you store temporary Athena query results.
 - For **IAM User** authentication, enter the _AWS Access Key_ and _AWS Secret Key_ you configured.
 - For **IAM Role** authentication, enter the following:
 - Set the _AWS Role ARN_ to the ARN of the [role you created in your AWS account](https://docs.atlan.com/llms/connectors/amazon-athena/set-up-amazon-athena/llms.txt).
 - (Optional) Under _External ID_, click the **Generate** button. Click the button to the right of this field to copy the generated ID and use it in [setting up your trust policy](https://docs.atlan.com/llms/connectors/amazon-athena/set-up-amazon-athena/llms.txt).
3. (Optional) For _Workgroup_, you can override the default _primary_ [workgroup](https://docs.aws.amazon.com/athena/latest/ug/user-created-workgroups.html) for tracking compute costs, granular permission controls, and more.

4. Click **Test Authentication** to confirm connectivity to Amazon Athena.

5. Once successful, at the bottom of the screen, click **Next**.

## Configure the connection

To complete the Amazon Athena connection configuration:

1. Provide a _Connection Name_ that represents your source environment. For example, you might want to use values like `production`, `development`, `gold`, or `analytics`.

2. (Optional) To change the users able to manage this connection, change the users or groups listed under _Connection Admins_.

 :::warning

 If you do not specify any user or group, nobody will be able to manage the connection - not even admins.

 :::

3. (Optional) To prevent users from querying any Amazon Athena data, change _Allow SQL Query_ to **No**.

4. (Optional) To prevent users from previewing any Amazon Athena data, change _Allow Data Preview_ to **No**.

5. At the bottom of the screen, click the **Next** button to proceed.

## Configure the crawler

Before running the Amazon Athena crawler, you can further configure it.

You can override the defaults for any of these options:

- To select the assets you want to include in crawling, click **Include Metadata**. (This will default to all assets, if none are specified.)
- To select the assets you want to exclude from crawling, click **Exclude Metadata**. (This will default to no assets if none are specified.)
- To have the crawler ignore tables and views based on a naming convention, specify a [Java regular expression](https://www.freeformatter.com/java-regex-tester.html) in the _Exclude regex for tables & views_ field.
- For _Advanced Config_, keep _Default_ for the default configuration or click **Custom** to configure the crawler:
 - For _Use JDBC Internal Methods_, click **True** to enable JDBC internal methods for data extraction or click **False** to disable it.
 - For _Enable Source Level Filtering_, click **True** to enable schema-level filtering at source or click **False** to disable it.

:::info **Did you know?** 
 If an asset appears in both the include and exclude filters, the exclude filter takes precedence.

:::

## Run the crawler

To run the Amazon Athena crawler, after completing the steps above:

- To run the crawler once, immediately, at the bottom of the screen click the **Run** button.
- To schedule the crawler to run hourly, daily, weekly or monthly, at the bottom of the screen click the **Schedule & Run** button.

Once the crawler has completed running, you will see the assets in Atlan's asset page! 🎉

---
