- Run SQL queries against data stored in S3
- Browse data catalogs, databases, and table schemas
- Fetch query results as paginated rows
- Power dashboards and reports with data lake queries
- Reuse your existing Athena workgroups and result locations
Common use cases and example apps
How AWS Athena connections work
Each AWS Athena connection is tied to a single AWS region, with an optional workgroup and query result location. When you connect AWS Athena, you provide IAM credentials, and Lovable’s connector gateway signs every request with them. The credentials stay on the server and never reach your published app. Within your Lovable workspace:- You can create multiple AWS Athena connections.
- Each connection targets a specific region, and optionally a workgroup and result location.
- Each connection uses its own IAM credentials.
- Multiple projects within a single workspace can use the same connection.
How to connect AWS Athena
Workspace admins and owners can connect AWS Athena. When the connection is created, AWS Athena becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.Prerequisites
Before connecting AWS Athena, make sure you have:- An AWS account with data in S3 and tables defined in the Glue Data Catalog
- An IAM user with the Athena, Glue, and S3 permissions listed below
- Lovable workspace owner or admin role
All queries made through this connector run in your AWS account. Athena charges based on the amount of data each query scans, and AWS bills you directly, not Lovable.
Step 1: Create an IAM user with Athena access
Before setting up the connection in Lovable, create an IAM user in AWS with the minimum permissions needed. Athena needs three kinds of access: the Athena API itself, the Glue Data Catalog (where table definitions live), and the S3 buckets holding your data and query results.1
Open the AWS IAM console
Go to the AWS IAM console and create a new IAM user, or use an existing one, for Lovable to use.
2
Attach an Athena policy
Create and attach an inline policy, or managed policy, with the following permissions. Replace The Glue permissions are required because Athena resolves table definitions through the Glue Data Catalog. A missing Glue permission is the most common cause of failing queries after the connection itself verifies successfully.This policy scopes Glue access to a single database, which is enough to run queries against it. If your app needs to list every database in the catalog (for example, to browse your data catalog), grant
YOUR-REGION, YOUR-ACCOUNT-ID, YOUR-WORKGROUP, YOUR-DATABASE, YOUR-DATA-BUCKET, and YOUR-RESULTS-BUCKET with your actual values.glue:GetDatabase and glue:GetDatabases on arn:aws:glue:YOUR-REGION:YOUR-ACCOUNT-ID:database/* instead.3
Generate access keys
In the IAM user’s Security credentials tab, create an access key. Save both the Access key ID and Secret access key, since you’ll need them in the next step.
Step 2: Connect AWS Athena to Lovable
You can create multiple connections using different IAM credentials.1
Open AWS Athena in Connectors
Go to Connectors and select AWS Athena.
2
Add a connection
Click Add connection.
3
Configure the connection
- Display name: name the connection, for example
Athena Prod. This name is only used inside Lovable to identify the connection. - AWS region: select the region where your Athena workgroup lives. The default is US East (N. Virginia).
- Access key ID: paste the IAM access key ID from the previous step.
- Secret access key: paste the IAM secret access key paired with the access key ID.
- Workgroup (optional): the Athena workgroup queries run in. Defaults to
primary. - Query result location (optional): the S3 path where Athena writes query results, for example
s3://my-bucket/athena-results/. Leave it empty if the workgroup enforces its own result location.
4
Choose who can access this connection
Under Who can access this connection, decide who in your workspace can use the connection:
- Only you (default): only the person creating the connection can use it and its associated data.
- Invite specific people: only you and explicitly added workspace members can use the connection and its associated data.
- Invite entire workspace: click Invite entire workspace to make the connection available to everyone in your Lovable workspace.
5
Connect
Click Connect. Lovable verifies the credentials by looking up the configured workgroup in your region. If verification fails, check that the keys are correct and that the IAM policy includes
athena:GetWorkGroup on the workgroup.Limitations
The AWS Athena connector cannot:- Call AWS services other than Athena. The gateway only forwards Athena API operations, so your app cannot read S3 objects or manage Glue resources directly through this connection.
- Exceed the permissions of the IAM policy you attach. Queries fail if the credentials lack access to the data, the Glue Data Catalog, or the result location.
- Run queries synchronously. Results are available only after Athena finishes processing the query.
- Refresh or rotate access keys automatically. To rotate, create a new access key in IAM and update the Lovable connection.
- Support per-end-user AWS login. Each connection represents a single set of IAM credentials shared across all projects linked to it.
Manage your connection
Connections are managed from Connectors: select , then open the connection.- Unlink projects to remove access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
- Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use stop working until a new connection is added. See Delete a connection for the steps and who can delete.