Skip to content

Commit 1f3a360

Browse files
committed
More data warehouse updates
1 parent fb9d357 commit 1f3a360

File tree

2 files changed

+29
-36
lines changed

2 files changed

+29
-36
lines changed

src/unify/linked-profiles/setup-guides/redshift-setup.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ On this page, you'll learn how to connect your Redshift data warehouse to Segmen
1010

1111
To get started with Redshift:
1212
1. Log in to Redshift and select the Redshift cluster you want to connect.
13-
2. Follow [these instructions](/docs/connections/storage/catalog/redshift/#networking) to configure the correct network and security settings.
13+
2. Follow [these instructions](/docs/connections/storage/catalog/redshift/#networking) to configure network and security settings.
1414

1515
## Create a new role and user
1616

17-
Run the SQL commands below to create a role <segment_entities> and user <segment_entities_user>.
17+
Run the SQL commands below to create a role `(segment_entities)` and user `(segment_entities_user)`.
1818

1919
```sql
2020
-- create role
@@ -38,7 +38,7 @@ You'll need to grant access to schemas and tables that you'd like to enrich with
3838

3939
Grant schema permissions based on customer need. Visit Amazon's docs for more on [schema permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"} and to view [example commands](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT-examples.html){:target="_blank"} that you can use to grant permissions.
4040

41-
```sql
41+
```ts
4242
-- view specific schemas in database
4343
GRANT USAGE ON SCHEMA <schema-name> TO ROLE segment_entities;
4444
```
@@ -47,19 +47,17 @@ GRANT USAGE ON SCHEMA <schema-name> TO ROLE segment_entities;
4747

4848
Grant table permissions based on customer need. View descriptions of [table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"} from Amazon.
4949

50-
```sql
50+
```ts
5151
-- query data from a specific table in a schema
5252
GRANT SELECT ON TABLE <schema-name>.<table-name> TO ROLE segment_entities;
5353
```
5454

5555
### RETL table permissions
5656

57-
If you've used RETL in your database, and added a new user, you'll need to add the following table permissions:
57+
If you've used RETL in your database, and added a new user, you'll need to add the following [table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}:
5858

59-
```sql
59+
```ts
6060
GRANT USAGE, CREATE ON SCHEMA __segment_reverse_etl TO ROLE segment_entities;
6161

6262
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA __segment_reverse_etl TO ROLE segment_entities;
6363
```
64-
65-
Learn more about Redshift's [table permissions](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html){:target="_blank"}.

src/unify/linked-profiles/setup-guides/snowflake-setup.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Be sure to log in with a user that has read and write permissions so that Segmen
1111

1212
## Getting started
1313

14-
To get started:
14+
To get started with Snowflake:
1515

1616
1. Log in to your Snowflake account.
1717
2. Navigate to *Worksheets*.
@@ -32,21 +32,21 @@ Enter and run the code below to create a virtual warehouse. Linked Events needs
3232
AUTO_SUSPEND = 600 -- 5 minutes
3333
AUTO_RESUME = TRUE;
3434
```
35-
35+
3636
## Create a new role
3737

3838
Enter and run the code below to create specific roles for Linked Events. All Snowflake access is specified through roles, which are then assigned to the user you’ll create later.
3939

40-
```sql
40+
```ts
4141
-- create role
42-
GRANT USAGE ON SCHEMA <schema-name-1> TO ROLE segment_entities;
42+
GRANT ROLE segment_entities;
4343

4444
-- warehouse access
4545
GRANT USAGE ON WAREHOUSE segment_entities TO ROLE segment_entities;
4646

4747
-- database access
48-
GRANT USAGE ON DATABASE <your_database> TO ROLE segment_entities;
49-
GRANT CREATE SCHEMA ON DATABASE <your_database> TO ROLE segment_entities;
48+
GRANT USAGE ON DATABASE segment_entities TO ROLE segment_entities;
49+
GRANT CREATE SCHEMA ON DATABASE segment_entities TO ROLE segment_entities;
5050
```
5151

5252
## Create a new user
@@ -77,39 +77,32 @@ These tables need to live in the same database as the one used for storing sync
7777

7878
Run the following command to give access to specific schemas you want to use for enrichment.
7979

80-
```sql
81-
--view specific schemas in database
80+
```ts
81+
-- view specific schemas in database
8282
GRANT USAGE ON SCHEMA <schema-name-1> TO ROLE segment_entities;
8383
GRANT USAGE ON SCHEMA <schema-name-2> TO ROLE segment_entities;
84-
```
85-
86-
### Table access
87-
88-
Choose from the following commands to open up table level access to Segment based on your comfort level.
89-
90-
```sql
91-
-- query data from all tables in a database
92-
GRANT SELECT ON ALL TABLES IN DATABASE <your_database> TO ROLE
93-
segment_entities;
94-
95-
-- query data from future tables in a database
96-
GRANT SELECT ON FUTURE TABLES IN DATABASE <your_database> TO ROLE segment_entities;
9784

9885
-- query data from all tables in a schema
99-
GRANT SELECT ON ALL TABLES IN SCHEMA <schema-name> TO ROLE
100-
segment_entities;
86+
GRANT SELECT ON ALL TABLES IN SCHEMA <schema-name-1> TO ROLE segment_entities;
87+
GRANT SELECT ON ALL TABLES IN SCHEMA <schema-name-2> TO ROLE segment_entities;
10188

10289
-- query data from future tables in a schema
103-
GRANT SELECT ON FUTURE TABLES IN SCHEMA <schema-name> TO ROLE
104-
segment_entities;
90+
GRANT SELECT ON FUTURE TABLES IN SCHEMA <schema-name-1> TO ROLE segment_entities;
91+
GRANT SELECT ON FUTURE TABLES IN SCHEMA <schema-name-2> TO ROLE segment_entities;
92+
```
93+
94+
### Table access
95+
96+
If you'd like to restrict access to specific tables, use the following command:
10597

98+
```ts
10699
-- query data from a specific table in a schema
107100
GRANT SELECT ON TABLE <schema-name>.<table_name> TO ROLE segment_entities;
108101
```
109102

110103
### RETL table permissions
111104

112-
If you've used RETL in your database, and added a new user, you'll need to add the following table permissions described in [Snowflake's docs](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges).
105+
If Reverse ETL has ever run in your database, a Segment-managed schema is created and a new user is added. You'll need to add the following [table permissions](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges) with the command below.
113106

114107
```sql
115108
GRANT USAGE ON SCHEMA __segment_reverse_etl TO ROLE segment_entities;
@@ -121,9 +114,11 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA __segment_reverse_e
121114

122115
### Confirm table permissions
123116

124-
To confirm table permissions, run the following command:
117+
To confirm table permissions:
118+
1. Log in as the user you've created (`segment_entities_user`).
119+
2. Verify the role created has the correct permissions with the following command:
125120

126-
```sql
121+
```ts
127122
use role segment_entities;
128123
use <your_database>;
129124
show schemas;

0 commit comments

Comments
 (0)