Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Athena

Access configuration details to connect Soda to an Amazon Athena data source.

Connection configuration reference

Install the following package:

pip install soda-athena>4

Data source YAML

Create the config file:

soda data-source create -f ds_config.yml

The data source configuration YAML should look like the following:

ds_config.yml
type: athena
name: my_athena
connection:
  catalog: ${env.ATHENA_CATALOG}
  access_key_id: ${env.ATHENA_ACCESS_KEY_ID}
  secret_access_key: ${env.ATHENA_SECRET_ACCESS_KEY}
  staging_dir: ${env.ATHENA_STAGING_DIR} ## e.g., s3://my-company-athena-staging/query-results/
  region_name: ${env.ATHENA_REGION}
  work_group: ${env.ATHENA_WOKRGROUP}
#  role_arn: <my_role_arn>
#  profile_name: <my_aws_profile>
#  session_token: <my_session_token>

Connection test

Test the data source connection:


Required permissions

The IAM principal (user or role) used by Soda requires both IAM Policy permissions and AWS Lake Formation permissions. Lake Formation permissions take precedence, even AdministratorAccess in IAM Policy will not allow table access if Lake Formation permissions are not also granted.

1. Lake Formation permissions

In addition to the IAM Policy in the following section, grant the following Lake Formation permissions to the principal via the AWS Console → Lake Formation → Data permissions, or via CLI:

Tip: Lake Formation permissions always override IAM; ensure both are configured correctly.

If you see errors like User is not authorized to perform: lakeformation:GetDataAccess, check that Lake Formation SELECT and DESCRIBE permissions are granted for the relevant database and tables.

AWS terminology note: In AWS Glue and Lake Formation, "Database" is equivalent to "Schema" in Athena SQL. Both refer to a logical grouping of tables.

Additional Lake Formation permissions for Diagnostics Warehouse

2. IAM Policy permissions

Note on staging bucket: Athena writes all query results to the staging_dir configured in the connection. The Soda IAM principal must have PutObject on that location. This is the only location where Soda writes data.

Additional IAM Policy permissions for Diagnostics Warehouse


You are not logged in to Soda and are viewing the default public documentation. Learn more about Licensing & documentation access.

Last updated

Was this helpful?