Skip to content

Commit 2ce6b74

Browse files
Merge pull request #7566 from segmentio/retl-instructions
improve RETL setup instructions
2 parents 10c21c6 + 87aba65 commit 2ce6b74

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

src/connections/reverse-etl/reverse-etl-source-setup-guides/databricks-setup.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,26 @@ At a high level, when you set up Databricks for Reverse ETL, the configured serv
1212
## Required permissions
1313
* Make sure the service principal you use to connect to Segment has permissions to use that warehouse. In the Databricks console go to **SQL warehouses** and select the warehouse you're using. Navigate to **Overview > Permissions** and make sure the service principal you use to connect to Segment has *can use* permissions.
1414

15+
Note the Service Principal UUID from the [User Management Page](https://accounts.cloud.databricks.com/user-management/serviceprincipals/){:target="_blank”} (under Service Principals) for the following SQL operations.
16+
1517
* To grant access to read data from the tables used in the model query, run:
1618

1719
```
18-
GRANT USAGE ON SCHEMA <schema_name> TO `<service principal you are using to connect to Segment>`;
19-
GRANT SELECT, READ_METADATA ON SCHEMA <schema_name> TO `<service principal you are using to connect to Segment>`;
20+
GRANT USAGE ON SCHEMA <schema_name> TO `<service principal ID you are using to connect to Segment>`;
21+
GRANT SELECT, READ_METADATA ON SCHEMA <schema_name> TO `<service principal ID you are using to connect to Segment>`;
2022
```
2123
2224
* To grant Segment access to create a schema to keep track of the running syncs, run:
2325
2426
```
25-
GRANT CREATE on catalog <name of the catalog, usually hive_metastore or main if using unity-catalog> TO `<service principal you are using to connect to Segment>`;
27+
GRANT CREATE on catalog <name of the catalog, usually hive_metastore or main if using unity-catalog> TO `<service principal ID you are using to connect to Segment>`;
2628
```
2729
2830
* If you want to create the schema yourself instead and then give Segment access to it, run:
2931
3032
```
3133
CREATE SCHEMA IF NOT EXISTS __segment_reverse_etl;
32-
GRANT ALL PRIVILEGES ON SCHEMA __segment_reverse_etl TO `<service principal you are using to connect to Segment>`;
34+
GRANT ALL PRIVILEGES ON SCHEMA __segment_reverse_etl TO `<service principal ID you are using to connect to Segment>`;
3335
```
3436
3537
## Set up guide

src/connections/reverse-etl/reverse-etl-source-setup-guides/postgres-setup.md

+9
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ To set up Postgres with Reverse ETL:
3131

3232
-- allows the "segment" user to create new schemas on the specified database. (this is the name you chose when provisioning your cluster)
3333
GRANT CREATE ON DATABASE "<enter database name here>" TO "segment";
34+
35+
-- create Segment schema
36+
CREATE SCHEMA __segment_reverse_etl;
37+
38+
-- Allow user to use the Segment schema
39+
GRANT USAGE ON SCHEMA __segment_reverse_etl TO segment;
40+
41+
-- Grant all privileges on all existing tables in the Segment schema
42+
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA __segment_reverse_etl TO segment;
3443
```
3544
4. Make sure the user has correct access permissions to the database.
3645
5. Follow the steps listed in the [Add a source](/docs/connections/reverse-etl/setup/#step-1-add-a-source) section to finish adding Postgres as a source.

src/connections/reverse-etl/reverse-etl-source-setup-guides/redshift-setup.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,21 @@ To set up Redshift with Reverse ETL:
1515
2. Follow the [networking instructions](/docs/connections/storage/catalog/redshift/#networking) to configure the correct network and security settings.
1616
3. Run the SQL commands below to create a user named `segment`.
1717

18-
```ts
18+
```sql
1919
-- create a user named "segment" that Segment will use when connecting to your Redshift cluster.
2020
CREATE USER segment PASSWORD '<enter password here>';
2121

2222
-- allows the "segment" user to create new schemas on the specified database. (this is the name you chose when provisioning your cluster)
2323
GRANT CREATE ON DATABASE "<enter database name here>" TO "segment";
24+
25+
-- create Segment schema
26+
CREATE SCHEMA __segment_reverse_etl;
27+
28+
-- Allow user to use the Segment schema
29+
GRANT USAGE ON SCHEMA __segment_reverse_etl TO segment;
30+
31+
-- Grant all privileges on all current tables in the Segment schema
32+
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA __segment_reverse_etl TO segment;
2433
```
2534
4. Follow the steps listed in the [Add a source](/docs/connections/reverse-etl/setup/#step-1-add-a-source) section to finish adding Redshift as your source.
2635

src/connections/reverse-etl/reverse-etl-source-setup-guides/snowflake-setup.md

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Follow the instructions below to set up the Segment Snowflake connector. Segment
5555
-- database access
5656
GRANT USAGE ON DATABASE segment_reverse_etl TO ROLE segment_reverse_etl;
5757
GRANT CREATE SCHEMA ON DATABASE segment_reverse_etl TO ROLE segment_reverse_etl;
58+
GRANT CREATE TABLE ON SCHEMA __segment_reverse_etl TO ROLE segment_reverse_etl;
5859
```
5960
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.
6061

0 commit comments

Comments
 (0)