KBAISE/ for lovable
Library
Docs

Export Lovable logs to Amazon S3

about 15 minShippingchecked 5d agoOfficial page
The short version

You can automatically send your Lovable activity records to Amazon cloud storage on a regular schedule. Lovable connects securely using temporary permissions without storing your secret account keys.

Workspace administrators on an Enterprise plan who need to store Lovable audit logs in Amazon S3 for compliance or long-term analysis.

Do this, in order

  1. 1

    Open Data exports in your Lovable workspace settings, click New data export, and choose Amazon S3 as the destination.

    This opens the configuration screen that generates the exact security policies you need to apply in AWS.

  2. 2

    Enter your storage bucket name and an optional folder prefix where files will be saved.

    Lovable inserts these exact values into the permission policies so access is restricted only to that folder.

  3. 3

    Enter the Amazon Resource Name (ARN) for the role you plan to create in AWS.

    Lovable uses this identifier to assemble the matching trust policy.

  4. 4

    Go to AWS IAM and create a new role configured for Web identity using accounts.google.com as the identity provider.

    This enables Lovable to authenticate securely through Google federation rather than using static access keys.

  5. 5

    Replace the AWS role's trust policy with the exact Trust policy JSON generated in the Lovable setup panel.

    This ensures only your specific Lovable workspace is allowed to assume the role.

  6. 6

    Attach the Permissions policy JSON from the Lovable setup panel to the AWS role.

    This limits Lovable's AWS permissions strictly to writing, deleting, and managing upload files inside your specified folder.

  7. 7

    Select your data source in Lovable and click Test connection.

    Lovable verifies it can write and delete a small test file in your bucket, and automatically detects the bucket region.

  8. 8

    Click Create export to save and activate your scheduled export.

    Lovable re-tests the connection and begins exporting data files on schedule.

Paste this into your project

Create an SQL file named athena_queries.sql that defines an Amazon Athena external table for Lovable audit logs matching the exact documented schema, and include sample queries for converting timestamps, extracting scalar values from the details JSON, and deduplicating records by id.

Words decoded

Amazon S3
Amazon's cloud file storage service, which organizes files into containers called buckets.
IAM Role
A set of temporary permissions in Amazon Web Services that an external service can borrow to perform specific tasks.
Role ARN
A unique address identifier that points to a specific role in your Amazon account.
Trust policy
A security rule in AWS specifying exactly who is permitted to borrow an IAM role.
Web identity federation
A method to prove identity through a trusted third party (like Google) to obtain short-lived access without sharing secret passwords.

Where people get stuck

  • Never change the trust policy condition from oaud to aud; doing so could allow other Lovable workspaces knowing your role ARN to assume your role.
  • Do not clear or change the folder prefix in Lovable without updating your AWS policy first, or write access to the bucket will fail.
  • Ensure your AWS role has delete permissions enabled, otherwise cleanup of test files and aborted upload attempts will fail.
  • You cannot edit the bucket name on an existing export; you must create a new export if you need to use a different bucket.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.