AWS Athena
Discover Athena data and run bounded asynchronous SQL queries from a Swarmz project
Connect AWS Athena when a project needs to query data stored in Amazon S3. Swarmz signs each request on the server. The access key, secret key, and optional session token never reach generated browser code.
Athena uses one shared workspace connection. Queries run under the IAM permissions, workgroup controls, and result location attached to that connection.
Availability
A Swarmz administrator must show AWS Athena under Platform config > Integrations and enable the data and analytics connector flag. Athena does not require a Swarmz OAuth application.
Before you connect
Create an IAM principal with only the Athena, Glue Data Catalog, and S3 permissions required by the project. Include access to the configured query-result bucket. Do not use an AWS root access key. AWS explains Athena IAM access.
You need:
- An AWS access key ID and secret access key.
- The AWS region that hosts Athena.
- Optional temporary session token.
- Optional workgroup, catalog, database, and
s3://query-result location.
Connect AWS Athena
- In the Swarmz project, open Settings > Integrations and select AWS Athena.
- Enter the AWS access key ID and AWS secret access key.
- If the credentials are temporary, enter the AWS session token.
- Enter the AWS region. Add the workgroup, catalog, database, and query-result location when the project should use values other than the connection defaults.
- Select Save connection.
Swarmz signs a GetWorkGroup request before saving the configured connection. A wrong region, expired session token, missing workgroup permission, or blocked result bucket causes setup to fail.
Available operations
| Operation | What it does | Limit per minute |
|---|---|---|
get_workgroup | Reads one workgroup | 30 |
list_data_catalogs | Lists data catalogs | 30 |
list_databases | Lists databases in a catalog | 30 |
list_tables | Lists table metadata | 30 |
get_table | Reads one table definition | 30 |
start_query | Starts an asynchronous SQL query | 10 |
get_query | Reads query status | 30 |
get_results | Reads one bounded result page | 30 |
stop_query | Stops an active query | 10 |
Starting or stopping a query requires allow-once approval. The AI starts a query, polls the returned query ID, and reads results only after Athena reports completion.
Ask the AI to use AWS Athena
- “Build a dashboard from the
reporting.eventstable. Discover its columns before writing the query.” - “Run the monthly revenue query in our analytics workgroup and show its status while it runs.”
- “Stop the active Athena query after showing me the exact query ID.”
Verify AWS Athena
- Read the configured workgroup.
- List catalogs, databases, and tables until the intended table appears.
- Start
select 1, poll its status, then read the result page. - Open the Athena console and confirm the query used the expected workgroup and result location.
To rotate credentials, edit the connection and repeat the read checks before disabling the old IAM key. To remove access, select Remove in Swarmz, then revoke the IAM key.