accounts.google.com.
For sources, schedules, and run behavior, see Data exports.
Prerequisites
- An S3 bucket.
- Permission in AWS IAM to create a role and attach a policy to it.
- The workspace admin or owner role in Lovable, on an Enterprise plan.
Set up the export
Create the export in Lovable and an IAM role in AWS. The setup panel fills in the role policies with your values.1
Start a new export
Go to Data exports, click New data export, and choose Amazon S3 under Destination.
2
Enter the bucket and prefix
Enter the Bucket name, for example
acme-lovable-exports. Under Prefix (optional), enter a folder for the files, or leave it blank to use lovable-export/. The setup panel fills in the policies with these values.3
Enter the role ARN
Choose a name for the IAM role and enter its ARN in Role ARN, for example
arn:aws:iam::123456789012:role/LovableExportWriter. The ARN is arn:aws:iam::<account ID>:role/<role name>, so you can enter it before the role exists. The setup panel uses it in the trust policy.4
Create the IAM role
In AWS IAM, create a role with that name for Web identity with the identity provider
accounts.google.com.5
Set the trust policy
Replace the role’s trust policy with the Trust policy JSON from the setup panel. It lets only Lovable’s service account assume the role, and only for this Lovable workspace and this role. If you change Role ARN later, update the trust policy again.
6
Attach the permissions policy
Attach the Permissions policy JSON from the setup panel to the role. It allows
s3:PutObject, s3:DeleteObject, and s3:AbortMultipartUpload under your prefix only.7
Choose the source and test
Choose the Source and click Test connection. Lovable writes and deletes a small test object named
.lovable-export-test under your prefix. When the test passes, Lovable shows the bucket’s region.8
Create the export
Click Create export. Lovable runs the same test again when you save.
Exported files
Each run writes one file per window under your prefix. See Object storage file layout for the full path. For example:Query with Amazon Athena
Point an external table at thesource= folder of your export. Athena reads every run and window below it. Copy the workspace= and export= folder names from a real object key.
timestampis text such as2026-10-13 09:41:07.123456. Read it withfrom_iso8601_timestamp(replace("timestamp", ' ', 'T') || 'Z').detailsin audit logs is a JSON string. Read a field withjson_extract_scalar(details, '$.name').- Remove duplicates by keeping one row per
id, for example withSELECT DISTINCTorrow_number() OVER (PARTITION BY id).
Troubleshooting
Could not assume the role
Could not assume the role
The role’s trust policy does not let Lovable assume it. Replace the trust policy with the one from the setup panel, without changes. Check that the role trusts the identity provider
accounts.google.com for web identity.AWS could not validate the identity token
AWS could not validate the identity token
The role probably trusts a custom OIDC provider for
accounts.google.com that does not list your workspace’s audience. Use the trust policy from the setup panel as is, with the built-in accounts.google.com principal. Or add the audience from the setup panel to your custom provider.Bucket not found
Bucket not found
Check the bucket name. The bucket must exist.
Could not determine bucket region
Could not determine bucket region
Lovable could not reach the bucket to find its region. Check that the bucket name is correct and that the bucket exists.
Write to bucket denied
Write to bucket denied
The role cannot write under your prefix (
s3:PutObject). Attach the permissions policy from the setup panel. If you changed the prefix, update the policy to match.Connected, but cleanup is blocked
Connected, but cleanup is blocked
Lovable can write but not delete (
s3:DeleteObject). The test object stays in the bucket, and Lovable cannot clean up after a failed run. Add delete permission under the prefix. You can still save the export.