Snowflake Reverse ETL Setup
Beta
This feature is in active development and may change before it's generally availabile.
Set up Snowflake as your Reverse ETL source.
At a high level, when you set up Snowflake for Reverse ETL, the configured user/role needs read permissions for any resources (databases, schemas, tables) the query needs to access. Segment keeps track of changes to your query results with a managed schema
(__SEGMENT_REVERSE_ETL), which requires the configured user to allow write permissions for that schema.
Snowflake Reverse ETL sources support Segment's dbt extension
If you have an existing dbt account with a Git repository, you can use Segment's dbt extension to centralize model management and versioning, reduce redundancies, and run CI checks to prevent breaking changes.
Follow the instructions below to set up the Segment Snowflake connector. Segment recommends you use the ACCOUNTADMIN role to execute all the commands below, and that you create a user that authenticates with an encrypted key pair. Segment's Snowflake integration only supports authentication using a key pair, as Snowflake plans to deprecate password-only authentication starting August 2026. Learn more in the Snowflake docs.
Set up your source using Terraform
Segment has a Terraform provider, powered by the Public API, that you can use to create a Snowflake Reverse ETL source. See the segment_source (Resource) documentation for more information.
-
Log in to your Snowflake account.
-
Navigate to Worksheets.
-
Enter and run the code below to create a database. Segment uses the database specified in your connection settings to create a schema called
__segment_reverse_etlto avoid collision with your data. The schema is used for tracking changes to your model query results between syncs. An existing database can be reused, if desired. Segment recommends you to use the same database across all your models attached to this source to keep all the state tracking tables in 1 place.1-- not required if another database is being reused2CREATE DATABASE segment_reverse_etl; -
Enter and run the code below to create a virtual warehouse. Segment Reverse ETL needs to execute queries on your Snowflake account, which requires a Virtual Warehouse to handle the compute. You can also reuse an existing warehouse.
1-- not required if reusing another warehouse2CREATE WAREHOUSE segment_reverse_etl3WITH WAREHOUSE_SIZE = 'XSMALL'4WAREHOUSE_TYPE = 'STANDARD'5AUTO_SUSPEND = 600 -- 5 minutes6AUTO_RESUME = TRUE; -
Enter and run the code below to create specific roles for Reverse ETL. All Snowflake access is specified through roles, which are then assigned to the user you'll create later.
1-- create role2CREATE ROLE segment_reverse_etl;34-- warehouse access5GRANT USAGE ON WAREHOUSE segment_reverse_etl TO ROLE segment_reverse_etl;67-- database access8GRANT USAGE ON DATABASE segment_reverse_etl TO ROLE segment_reverse_etl;9GRANT CREATE SCHEMA ON DATABASE segment_reverse_etl TO ROLE segment_reverse_etl;10GRANT CREATE TABLE ON SCHEMA __segment_reverse_etl TO ROLE segment_reverse_etl; -
Create the user Segment will use to run queries.
- Create the user and assign it a key pair following the instructions in the Snowflake docs.
- Execute the following SQL commands:
1-- create user (key-pair authentication)2CREATE USER segment_reverse_etl_user3DEFAULT_ROLE = segment_reverse_etl4RSA_PUBLIC_KEY = 'enter your public key';56-- role access7GRANT ROLE segment_reverse_etl TO USER segment_reverse_etl_user; -
Add the account information for your source.
-
Click Test Connection to test to see if the connection works.
-
Click Add source if the test connection is successful.
Learn more about the Snowflake Account ID in Snowflake's Account identifiers documentation.
After you've successfully added your Snowflake source, add a model and follow the rest of the steps in the Reverse ETL setup guide.
If you create a network policy with Snowflake and are located in the US, add 52.25.130.38/32 and 34.223.203.0/28 to the "Allowed IP Addresses" list.
If you create a network policy with Snowflake and are located in the EU, add 3.251.148.96/29 to your "Allowed IP Addresses" list.