-
Notifications
You must be signed in to change notification settings - Fork 3
/
product.yml
237 lines (237 loc) · 7.78 KB
/
product.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
databases:
- name: "P_{{ env }}_{{ product }}"
schemas:
- name: MAIN
- name: INTEGRATION
- name: SHARED
warehouses:
- name: "P_{{ env }}_{{ product }}_WH"
parameters:
- name: WAREHOUSE_SIZE
value: "{{ warehouse_size }}"
- name: INITIALLY_SUSPENDED
value: true
- name: SCALING_POLICY
value: "{{ scaling_policy }}"
- name: AUTO_SUSPEND
value: "{{ auto_suspend }}"
- name: AUTO_RESUME
value: "{{ auto_resume }}"
- name: MIN_CLUSTER_COUNT
value: "{{ min_cluster_count }}"
- name: MAX_CLUSTER_COUNT
value: "{{ max_cluster_count }}"
roles:
# Warehouse
- name: AR_P_{{ env }}_{{ product }}_WH
- name: AR_P_{{ env }}_{{ product }}_WH_ADMIN
# Data
- name: DR_P_{{ env }}_{{ product }}_RW
- name: DR_P_{{ env }}_{{ product }}_RO
- name: DR_P_{{ env }}_{{ product }}_SHARED
# Functional
- name: FR_P_{{ env }}_{{ product }}_ADMIN
- name: FR_P_{{ env }}_{{ product }}_ENGINEER
- name: FR_P_{{ env }}_{{ product }}_READER
privileges:
# Warehouse
# ADMIN
- privilege: "ALL PRIVILEGES"
objectType: "WAREHOUSE"
objectName: "P_{{ env }}_{{ product }}_WH"
roleName: "AR_P_{{ env }}_{{ product }}_WH_ADMIN"
grantOption: true
# USER
- privilege: "USAGE"
objectType: "WAREHOUSE"
objectName: "P_{{ env }}_{{ product }}_WH"
roleName: "AR_P_{{ env }}_{{ product }}_WH"
grantOption: false
# Database
# ADMIN
- privilege: "ALL PRIVILEGES"
objectType: "DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "FR_P_{{ env }}_{{ product }}_ADMIN"
grantOption: true
# USER
- privilege: "USAGE"
objectType: "DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "USAGE"
objectType: "DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
- privilege: "USAGE"
objectType: "DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_SHARED"
grantOption: false
# Schema
# ADMIN
- privilege: "ALL PRIVILEGES"
objectType: "ALL SCHEMAS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: true
# USER
- privilege: "USAGE"
objectType: "ALL SCHEMAS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
- privilege: "USAGE"
objectType: "SCHEMA"
objectName: "P_{{ env }}_{{ product }}.SHARED"
roleName: "DR_P_{{ env }}_{{ product }}_SHARED"
grantOption: false
# Table
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE TABLES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE TABLES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE TABLES IN SCHEMA"
objectName: "P_{{ env }}_{{ product }}.SHARED"
roleName: "DR_P_{{ env }}_{{ product }}_SHARED"
grantOption: false
# External Table
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE EXTERNAL TABLES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE EXTERNAL TABLES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE EXTERNAL TABLES IN SCHEMA"
objectName: "P_{{ env }}_{{ product }}.SHARED"
roleName: "DR_P_{{ env }}_{{ product }}_SHARED"
grantOption: false
# View
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE VIEWS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE VIEWS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE VIEWS IN SCHEMA"
objectName: "P_{{ env }}_{{ product }}.SHARED"
roleName: "DR_P_{{ env }}_{{ product }}_SHARED"
grantOption: false
# Materialized View
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE MATERIALIZED VIEWS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE MATERIALIZED VIEWS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
- privilege: "SELECT"
objectType: "FUTURE MATERIALIZED VIEWS IN SCHEMA"
objectName: "P_{{ env }}_{{ product }}.SHARED"
roleName: "DR_P_{{ env }}_{{ product }}_SHARED"
grantOption: false
# Stream
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE STREAMS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
# Task
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE TASKS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "MONITOR"
objectType: "FUTURE TASKS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
# Stage
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE STAGES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
- privilege: "READ"
objectType: "FUTURE STAGES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RO"
grantOption: false
# File Format
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE FILE FORMATS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
# Sequence
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE SEQUENCES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
# Function
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE FUNCTIONS IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
# Procedure
- privilege: "ALL PRIVILEGES"
objectType: "FUTURE PROCEDURES IN DATABASE"
objectName: "P_{{ env }}_{{ product }}"
roleName: "DR_P_{{ env }}_{{ product }}_RW"
grantOption: false
roleGrants:
- name: "AR_P_{{ env }}_{{ product }}_WH"
roles:
- "FR_P_{{ env }}_{{ product }}_READER"
- name: "AR_A_TASK_OPERATOR"
roles:
- "FR_P_{{ env }}_{{ product }}_ENGINEER"
- name: "AR_I_ADLS_PHDATA_SNOWFLAKE_STAGE"
roles:
- "FR_P_{{ env }}_{{ product }}_ENGINEER"
- name: "AR_P_{{ env }}_{{ product }}_WH_ADMIN"
roles:
- "FR_P_{{ env }}_{{ product }}_ENGINEER"
- name: "DR_P_{{ env }}_{{ product }}_SHARED"
roles:
- "DR_P_{{ env }}_{{ product }}_RO"
- name: "DR_P_{{ env }}_{{ product }}_RO"
roles:
- "DR_P_{{ env }}_{{ product }}_RW"
- name: "DR_P_{{ env }}_{{ product }}_RO"
roles:
- "FR_P_{{ env }}_{{ product }}_READER"
- name: "DR_P_{{ env }}_{{ product }}_RW"
roles:
- "FR_P_{{ env }}_{{ product }}_ENGINEER"
- name: "FR_P_{{ env }}_{{ product }}_ENGINEER"
roles:
- "FR_P_{{ env }}_{{ product }}_ADMIN"
- name: "FR_P_{{ env }}_{{ product }}_ADMIN"
roles:
- "SYSADMIN"