Amazon Athena
User Guide

Deploying a Connector and Connecting to a Data Source

Preparing to create federated queries is a two-part process: deploying a Lambda function data source connector, and connecting the Lambda function to a data source. In the first part, you give the Lambda function a name that you can later choose in the Athena console. In the second part, you give the connector a name that you can reference in your SQL queries.

Part 1: Deploying a Data Source Connector

To choose, name, and deploy a data source connector, you use the Athena and Lambda consoles in an integrated process.

Note

To use this feature in preview, you must create an Athena workgroup named AmazonAthenaPreviewFunctionality and join that workgroup. For more information, see Managing Workgroups.

To deploy a data source connector

  1. Open the Athena console at https://console.aws.amazon.com/athena/.

  2. Choose Connect data source.

  3. On the Connect data source page, choose Query a data source.

  4. For Choose a data source, choose the data source that you want to query with Athena, such as Amazon CloudWatch Logs.

  5. Choose Next.

  6. For Lambda function, choose Configure new function. The function page for the connector that you chose opens in the Lambda console. The page includes detailed information about the connector.

  7. Under Application settings, enter the required information. At a minimum, this includes:

    • AthenaCatalogName – A name for the Lambda function that indicates the data source that it targets, such as cloudwatchlogs.

    • SpillBucket – An Amazon S3 bucket in your account to store data that exceeds Lambda function response size limits.

  8. Select I acknowledge that this app creates custom IAM roles. For more information, choose the Info link.

  9. Choose Deploy. The Resources section of the Lambda console shows the deployment status of the connector and informs you when the deployment is complete.

Part 2: Connecting to a Data Source

After you deploy the data source connector to your account, you can connect it to a data source.

To connect to a data source using a connector that you have deployed to your account

  1. Open the Athena console at https://console.aws.amazon.com/athena/.

  2. Choose Connect data source.

  3. Choose Query a data source.

  4. Choose the data source for the connector that you just deployed, such as Amazon CloudWatch Logs. If you used the Athena Query Federation SDK to create your own connector and have deployed it to your account, choose All other data sources.

  5. Choose Next.

  6. For Choose Lambda function, choose the function that you named. The Lambda function's ARN is displayed.

  7. For Catalog name, enter a unique name to use for the data source in your SQL queries, such as cloudwatchlogs. The name can be up to 127 characters and must be unique within your account. It cannot be changed after creation. Valid characters are a-z, A-z, 0-9, _(underscore), @(ampersand) and -(hyphen).

  8. Choose Connect. The Data sources page now shows your connector in the list of catalog names. You can now use the connector in your queries.

    For information about writing queries with data connectors, see Writing Federated Queries.