You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/reverse-etl/reverse-etl-source-setup-guides/snowflake-setup.md
+7-18Lines changed: 7 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,6 @@ Set up Snowflake as your Reverse ETL source.
9
9
10
10
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 <br>(`__SEGMENT_REVERSE_ETL`), which requires the configured user to allow write permissions for that schema.
11
11
12
-
> success ""
13
-
> Segment now supports key-pair authentication for Snowflake Reverse ETL sources.
14
12
15
13
> info "Snowflake Reverse ETL sources support Segment's dbt extension"
16
14
> If you have an existing dbt account with a Git repository, you can use [Segment's dbt extension](/docs/segment-app/extensions/dbt/) to centralize model management and versioning, reduce redundancies, and run CI checks to prevent breaking changes.
@@ -57,9 +55,12 @@ Follow the instructions below to set up the Segment Snowflake connector. Segment
57
55
GRANT CREATE SCHEMA ON DATABASE segment_reverse_etl TO ROLE segment_reverse_etl;
58
56
GRANT CREATE TABLE ON SCHEMA __segment_reverse_etl TO ROLE segment_reverse_etl;
59
57
```
60
-
6. Enter and run one of the following code snippets below to create the user Segment uses to run queries. For added security, Segment recommends creating a user that authenticates using a key pair.
58
+
6. Enter and run one of the following code snippets below to create the user Segment uses to run queries.
59
+
60
+
1. To create a user that authenticates with a key pair, you need to first create the user and assign it a key pair following the instructions in the [Snowflake docs](https://docs.snowflake.com/en/user-guide/key-pair-auth){:target="_blank”}.
61
+
62
+
2. Execute the following SQL commands:
61
63
62
-
To create a user that authenticates with a key pair, [create a key pair](https://docs.snowflake.com/en/user-guide/key-pair-auth#configuring-key-pair-authentication){:target="_blank”} and then execute the following SQL commands:
63
64
```sql
64
65
-- create user (key-pair authentication)
65
66
CREATEUSERsegment_reverse_etl_user
@@ -69,21 +70,9 @@ Follow the instructions below to set up the Segment Snowflake connector. Segment
69
70
-- role access
70
71
GRANT ROLE segment_reverse_etl TO USER segment_reverse_etl_user;
71
72
```
72
-
73
-
To create a user that authenticates with a password, execute the following SQL commands:
74
-
```sql
75
-
-- create user (password authentication)
76
-
CREATEUSERsegment_reverse_etl_user
77
-
MUST_CHANGE_PASSWORD = FALSE
78
-
DEFAULT_ROLE = segment_reverse_etl
79
-
PASSWORD ='my_strong_password'; -- Do not use this password
80
-
81
-
-- role access
82
-
GRANT ROLE segment_reverse_etl TO USER segment_reverse_etl_user;
83
-
```
84
73
7. Add the account information for your source.
85
-
5. Click **Test Connection** to test to see if the connection works.
86
-
6. Click **Add source** if the test connection is successful.
74
+
8. Click **Test Connection** to test to see if the connection works.
75
+
9. Click **Add source** if the test connection is successful.
87
76
88
77
89
78
Learn more about the Snowflake Account ID in Snowflake's [Account identifiers](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html){:target="_blank"} documentation.
Copy file name to clipboardExpand all lines: src/connections/storage/catalog/snowflake/index.md
+4-100Lines changed: 4 additions & 100 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,35 +89,11 @@ GRANT CREATE SCHEMA ON DATABASE "SEGMENT_EVENTS" TO ROLE "SEGMENT";
89
89
90
90
### Step 4: Create a user for Segment
91
91
92
-
Create the user that Segment uses to connect to your warehouse. You can create a user that authenticates with a key pair, or you can create a user that authenticates using a password. For enhanced security, Segment recommends creating a user that authenticates with an encrypted key pair.
92
+
Create the user that Segment uses to connect to your warehouse. You can create a user that authenticates with a key pair.
93
93
94
-
#### Create a user that authenticates with a key pair
95
-
If you are creating a user that will use a key pair to authenticate, you first must create a public key and then can create a new user.
96
-
97
-
##### Generate keys
98
-
99
-
To start, open a terminal window and generate a private key by running the following command, replacing `key_name` with the name you'd like to give the key. The command generates a private key in PEM format, and will prompt you to enter a passphrase. Write down or remember this passphrase, as you will need it when creating your Segment user and configuring your destination in the Segment app.
100
-
101
-
> success ""
102
-
> If you want to generate an unencrypted private key, append `-nocrypt` to the end of the command.
After you've created the private key, save the file to a local directory. You'll need to upload the .p8 file to the Segment app when you create your Snowflake destination.
109
-
110
-
Next, generate your public key by running the following command, replacing `key_name.p8` with the name of the private key that you previously created and `public_key_name` with the name of your new public key.
After you've created the public key, save the file to a local directory.
117
-
118
-
##### Generate a new user and assign the key to them
119
-
120
-
Now, create a new user by executing the following SQL command, replacing the public key value with the key you previously generated.
94
+
To create a user that authenticates with a key pair:
95
+
1. Create the user and assign it a key pair by following the instructions in the [Snowflake docs](https://docs.snowflake.com/en/user-guide/key-pair-auth){:target="_blank"}.
96
+
2. Create a new user by executing the following SQL command, replacing the public key value with the key you previously generated.
121
97
122
98
```sql
123
99
CREATEUSERSEGMENT_USER
@@ -126,17 +102,6 @@ CREATE USER SEGMENT_USER
126
102
GRANT ROLE "SEGMENT" TO USER "SEGMENT_USER";
127
103
```
128
104
129
-
#### Create a user that authenticates with a username and password
130
-
If you are creating a user that will use a username and password to authenticate, execute the following SQL command. Be sure to set a strong, unique password.
131
-
132
-
```sql
133
-
CREATEUSER "SEGMENT_USER"
134
-
MUST_CHANGE_PASSWORD = FALSE
135
-
DEFAULT_ROLE ="SEGMENT"
136
-
PASSWORD ="my_strong_password"; -- Do not use this password
137
-
GRANT ROLE "SEGMENT" TO USER "SEGMENT_USER";
138
-
```
139
-
140
105
### Step 5: Test the user and credentials
141
106
142
107
Before you continue, test and validate the new user and credentials. After you verify the new credentials, you can connect Snowflake to Segment.
@@ -157,67 +122,6 @@ For accounts outside the US, the account ID includes the region. You can find yo
157
122
158
123
For example, if your web address is `https://myaccountname.snowflakecomputing.com/console#/internal/worksheet`, your account name would be `myaccountname`.
159
124
160
-
#### Test a username and password
161
-
Segment uses [SnowSQL](https://docs.snowflake.com/en/user-guide/snowsql){:target="_blank"} to run these verification steps.
3. When the installation is complete, run the following command, replacing "account" and "user" with your Snowflake Account ID and username:
167
-
168
-
```
169
-
snowsql -a <account> -u <user>
170
-
```
171
-
172
-
For accounts outside the US, the account ID includes the region. You can find your account name from the browser address string.
173
-
174
-
For example, if your web address is `https://myaccountname.snowflakecomputing.com/console#/internal/worksheet`, your account name would be `myaccountname`.
175
-
176
-
You can also find part of your account name by running the following query on your worksheet in Snowflake:
Copy file name to clipboardExpand all lines: src/unify/data-graph/setup-guides/snowflake-setup.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,13 +150,13 @@ To connect your warehouse to the Data Graph:
150
150
2. Click **Connect warehouse**.
151
151
3. Select Snowflake as your warehouse type.
152
152
4. Enter your warehouse credentials. Segment requires the following settings to connect to your Snowflake warehouse:
153
-
-**Account ID**: The Snowflake account ID that uniquely identifies your organization account
154
-
-**Database**: The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_connection_db` in the script below
155
-
-**Warehouse**: The [warehouse](https://docs.snowflake.com/en/user-guide/warehouses){:target="_blank”} in your Snowflake account that you want to use for Segment to run the SQL queries. This warehouse is referred to as `segment_connection_warehouse` in the script below
156
-
-**Username**: The Snowflake user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_connection_username` in the script below
157
-
-**Authentication**: There are 2 supported authentication methods:
158
-
-**Key Pair**: This is the recommended method of authentication. You would need to first create the user and assign it a key pair following the instructions in the [Snowflake docs](https://docs.snowflake.com/en/user-guide/key-pair-auth){:target="_blank"}. Then, follow the Segment docs above to set up Snowflake permissions and set the `segment_connections_username` variable in the SQL script to the user you just created
159
-
-**Password**: The password of the user above. This password is referred to as `segment_connection_password` in the script below
153
+
-**Account ID**: The Snowflake account ID that uniquely identifies your organization account.
154
+
-**Database**: The only database that Segment requires write access to in order to create tables for internal bookkeeping. This database is referred to as `segment_connection_db` in the script below.
155
+
-**Warehouse**: The [warehouse](https://docs.snowflake.com/en/user-guide/warehouses){:target="_blank”} in your Snowflake account that you want to use for Segment to run the SQL queries. This warehouse is referred to as `segment_connection_warehouse` in the script below.
156
+
-**Username**: The Snowflake user that Segment uses to run SQL in your warehouse. This user is referred to as `segment_connection_username` in the script below.
157
+
-**Authentication**: Snowflake only supports authentication using a key pair:
158
+
-**Key Pair**: You need to first create the user and assign it a key pair following the instructions in the [Snowflake docs](https://docs.snowflake.com/en/user-guide/key-pair-auth){:target="_blank"}. Then, set the `segment_connections_username` variable in the SQL script to the user you just created.
0 commit comments