# Snowflake

<figure><img src="https://1875572357-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzP7hFWzU2Jj7xMbv2nyp%2Fuploads%2Fgit-blob-b353f0395581e7b01665c0f6de54b74b0e05a3f2%2Fsnow.png?alt=media" alt=""><figcaption></figcaption></figure>

With Codatum, you can connect, query, and manage data of Snowflake.

## How to Set Up

### 1. Prepare a Key-Pair and Snowflake User

Currently, only key-pair authentication is supported. Refer to the [Snowflake user-guide key-pair-auth](https://docs.snowflake.com/en/user-guide/key-pair-auth) for instructions on creating a key pair and associating the public key with the Snowflake user you plan to use for the connection.

### 2. Grant the Necessary Privileges

You must grant privileges to the role assigned to the Snowflake user:

* Prepare a Role
  * Create a new role or use an existing one, then assign it to the user you created.
* Warehouse Privileges
  * Grant the `USAGE` privilege on the warehouse you want to use to that role.
* Database Privileges
  * Grant the `USAGE` privilege on the database you want to use to that role.
* Schema Privileges
  * Grant the `USAGE` privilege on the schema you want to use to that role.
* Table Privileges
  * Grant the `SELECT` privilege on the table you want to use to that role.

### 3. Register the Snowflake Connection in Codatum

Finally, create Snowflake Connection in Codatum

1. In the `Workspace Settings` -> `Connections`, select `Add Connection`
2. Enter a `Connection Name`
3. Select the `Access Level`
4. Enter the `Organization name`
   * The name of your Snowflake organization. See [Snowflake user-guide admin-account-identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier#label-account-name-find) for more details.
5. Enter the `Account name`
   * The name of your Snowflake account. (Be careful not to confuse this with the full account identifier, which includes the organization name.) See [Snowflake user-guide admin-account-identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier#label-account-name-find) for more details.
6. Enter the `User name`
   * Use the User name you prepared in the step1.
7. Enter the `Role`
   * Use the Role name you prepared in the step2.
8. Enter the `Warehouse name`
   * Use the Warehouse name you prepared in the step2.
9. Enter the `Database name`
   * Specifies the default database in which statements are executed (like “namespace”). This setting does not limit which tables or schemas you can query.
10. Enter the `Private key`
    * Use the Private key you prepared in the step1.
    * Paste the entire private key, including the lines `\-----BEGIN PRIVATE KEY-----` and `-----END PRIVATE KEY-----`
11. Add datasets to the Sync target

## Network and Firewall Restrictions

Currently, Codatum does not provide a fixed IP address for connections. If you need to whitelist IP addresses in Snowflake for security reasons, please contact Codatum Support to discuss possible options.
