Prerequisites
- In order to complete the following setup steps, you or a Snowflake admin on your team must have the securityadmin and sysadmin roles. (To check your account for these roles, run
SHOW GRANTS TO USER <your_username>;and review therolecolumn.) - If your Snowflake data warehouse is using Snowflake Access Policies, you will need to have the data-syncing service’s static IP available to complete Step 2.
Step 1: Create role, user, warehouse, and database in the data warehouse
- Review and make any changes to the following setup script.
Using an existing
schemaBy default, a new schema (with a name you provide) will be created in the target Snowflake database upon the initial connection. If instead you create the schema ahead of time, you may remove the CREATE SCHEMA permission, and instead grant ALL PRIVILEGES on the target schema for the designated role.The script below can be used to complete this step:Using an existing
warehouse or databaseBy default, this script creates a new warehouse and a new database. If you’d prefer to use an existing warehouse/database, change the warehouse_name variable from TRANSFER_WAREHOUSE to the name of the warehouse to be shared/database_name variable from TRANSFER_DATABASE to the name of the database to be shared.- In the Snowflake interface, select the dropdown next to the “Run” button, and click Run All. This will run every query in the script at once. If successful, you will see
Statement executed successfullyin the query results.
Step 2: Configure the Snowflake access policy
If your Snowflake data warehouse is using Snowflake Access Policies, a new policy must be added to allow the transfer service static IP to write to the warehouse.- Review current network policies to check for existing IP safelists.
- If there is no existing Snowflake Network Policies (the
SHOWquery returns no results), you can skip to Step 3. - If there is an existing Snowflake Network Policy, you must alter the existing policy or create a new one to safelist the data transfer service static IP address. Use the
CREATE NETWORK POLICYcommand to specify the IP addresses that can access your Snowflake warehouse.
Creating your first network policyIf you have no existing network policies and you create your first as part of this step, all other IPs outside of the
ALLOWED_IP_LIST will be blocked. Snowflake does not allow setting a network policy that blocks your current IP address. (An error message results while trying to create a network policy that blocks the current IP address.) But be careful when setting your first network policy.