This guide walks you through configuring Amazon Athena as a destination for your Webflow Analyze and Optimize data export.
Create Athena target bucket
Follow these steps to create a bucket to be used for staging data before transferring to a destination.
Create Athena access policy
Navigate to the IAM service page, click on the Policies navigation tab, and click Create policy.
Click the JSON tab, and paste the following policy, being sure to replace ACCOUNT_ID, WORKGROUP, BUCKET_NAME and SCHEMA with the your account information.
WORKGROUP should be primary unless otherwise specified during connection configuration.BUCKET should refer to the bucket created in the previous step.SCHEMA used below does not need to be created ahead of time. If it does not exist, it will be created automatically before transferring data.Athena vs. S3 permissions
Because Athena uses S3 as the underlying storage layer, the Resource access requested in the policy is scoped down via resource-specific permissions in the S3 actions.
Click through to the Review step, choose a name for the policy, for example, transfer-service-policy (this will be referenced in the next step), add a description, and click Create policy.
Create role
Navigate to the IAM service page.
Navigate to the Roles navigation tab, and click Create role.
Select Custom trust policy and paste the provided trust policy (from the prerequisite) to allow AssumeRole access to this role. Click Next.
Add the permissions policy created above, and click Next.
Enter a Role name, for example, transfer-role, and click Create role.
Once successfully created, search for the created role in the Roles list, click the role name, and make a note of the ARN value.
Alternative authentication method: AWS User with HMAC Access Key ID & Secret Access Key
Role-based authentication is the preferred authentication mode for Athena based on AWS recommendations. However, HMAC Access Key ID & Secret Access Key is an alternative authentication method that can be used if preferred.
transfer-service, click Next. Under Select AWS access type, select the Access key - Programmatic access option. Click Next: Permissions.Use the following details to complete the connection setup: database, schema, workgroup, bucket name, bucket region, and IAM Role ARN.
Follow these guidelines to manage your new Athena tables effectively:
Optimize Iceberg queries
To optimize the performance of your Iceberg tables, use the OPTIMIZE command. This command reorganizes the data in a way that improves query efficiency. Execute the following query periodically:
Set vacuum properties
Iceberg tables can accumulate snapshots over time, which can affect performance. To manage this, set the maximum age for snapshots that the vacuum process should retain:
The default setting is 432000 seconds, we recommend only updating this if you notice degrading performance.
Perform time travel queries
Iceberg supports accessing historical data snapshots using time travel queries. This feature allows you to query the table as it appeared at a previous point in time, which is useful for audits and rollbacks:
Replace timestamp with the specific UNIX timestamp of the snapshot you wish to query.