Skip to main content
When importing from databases, many customers create separate tables/views for Aampe that are limited to only the data necessary for Aampe to function.

Connect Snowflake to Aampe (via Google Cloud Storage)

1. Create Snowflake Integration

Integrations are named, first-class Snowflake objects that avoid the need for passing explicit cloud provider credentials such as secret keys or access tokens; instead, integration objects reference a Cloud Storage service account. Aampe will provide you with the bucket link mentioned below.

2. Obtain GCP Service Account

A GCP Service account is created by Snowflake as part of Step 1:
In the output of the above command, the STORAGE_GCP_SERVICE_ACCOUNT property contains the GCP service account name. Example output:
We will take this service account and provide it permissions to add/modify data to the GCS bucket.

3. Create File Formats

A parquet file format can be created in Snowflake as follows to unload snowflake data in the parquet format. Any other format like CSV or JSON also can be created. Here is an example script to create parquet format:
More options and file types can be found here.

4. Create External Stage

In Snowflake, an EXTERNAL STAGE object references data files stored in a location outside of Snowflake.

5. Unload Data

From Snowflake, use the COPY command in Snowflake to unload data from a Snowflake table into a GCS bucket. To retain the column names in the output file, use the HEADER = TRUE copy option.
For example:
For the minimal fields we need, you can refer to Data Models. There are various parameters for COPY command which can limit the partitions and provide optimizations: https://docs.snowflake.com/en/sql-reference/sql/copy-into-location.html

6. Automate the Unloading

What we recommend is to automate the COPY command that unloads each day’s events (single partition) into the external stage by using Snowflake TASK for it to run at a schedule: https://docs.snowflake.com/en/sql-reference/sql/create-task.html An example of same would be:
If you use Airflow on your side for orchestration you can also use that to schedule this query at a regular interval. Alternatively we can fetch directly from Snowflake

Snowflake Direct Access Setup

Create a dedicated Aampe user with read-only access to your data warehouse. Once configured, we’ll handle the ETL scheduling on our side.

Step 1: Switch to Account Admin

Run this in your Snowflake worksheet:

Step 2: Create Role and User

Create a read-only role for Aampe (skip if you have an existing read-only role you’d prefer to use):

Step 3: Grant Read Access

Grant the role access to your warehouse, database, and tables. Adjust the scope as needed:

Step 4: Share Connection Details

Send us the following:
  • Account (from your URL, e.g., tzviibq-hr75240 from https://tzviibq-hr75240.snowflakecomputing.com)
  • Warehouse Name
  • Database Name
  • Schema Name
  • Table Names (tables containing your event data)
Once we receive these, we’ll configure the connection and begin syncing data at regular intervals. References: