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: docs/data-sources/policy.md
+2-5Lines changed: 2 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -43,12 +43,9 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
43
43
44
44
### Optional
45
45
46
-
#### Locate the policy resource
47
-
48
46
See [Locate the policy resource](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/resources/policy#optional) for details.
49
47
50
48
### Read-Only
51
49
52
-
#### The policy payload
53
-
54
-
See [The policy payload](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/resources/policy#the-policy-payload) for details.
50
+
- The policy payload. See [The policy payload](https://registry.terraform.io/providers/bytebase/bytebase/latest/docs/resources/policy#the-policy-payload) for details.
51
+
-`inherit_from_parent` (Boolean) Decide if the policy should inherit from the parent.
Copy file name to clipboardExpand all lines: docs/resources/environment.md
-3Lines changed: 0 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -41,9 +41,6 @@ You can check [examples](https://github.com/bytebase/terraform-provider-bytebase
41
41
-`resource_id` (String) The environment **unique resource id**. For example, `dev`, `dev-env`.
42
42
-`title` (String) The environment **unique name**. For example, `Dev`.
43
43
-`order` (Number) The environment sorting order. Starting with 1. Lower number appears first in the deployment pipeline.
44
-
45
-
### Optional
46
-
47
44
-`environment_tier_policy` (String) Check [Environment Tier](https://www.bytebase.com/docs/administration/environment-policy/tier) for details. Should be one of:
Access Control Policy is the policy configuration for database access control. It is only applicable to database and environment resource type.
153
-
For environment resource type, `disallow_rules` defines the access control rule.
154
-
For database resource type, the access control policy struct itself means allow to access.
159
+
160
+
- For environment resource type, if the `environment_tier_policy` is set to be `PROTECTED`, the `access_control_policy` is the disallow list for databases in this environment.
161
+
- For database resource type, the access control policy means allow to access in this specific database.
155
162
156
163
Must set the `access_control_policy` if the policy type if `ACCESS_CONTROL`. It contains following attributes:
157
164
158
-
-`disallow_rules` (List of Object)
165
+
-`disallow_rules` (List of Object) The object contains following attribute:
159
166
-`full_database` (Boolean) will apply to the full database.
instance = "<instance resource id for the database>"
196
+
database = "employee"
167
197
168
198
access_control_policy {
169
199
disallow_rules {
@@ -180,13 +210,16 @@ SQL Review Policy is the policy for SQL review.
180
210
Must set the `sql_review_policy` if the policy type if `SQL_REVIEW`. It contains following attributes:
181
211
182
212
-`title` (String) The title for SQL review.
183
-
-`rules` (List of Object) List of SQL review rules. The rule should a object contains:
184
-
-`type` (String) The SQL review rule type. You can check the [code](https://github.com/bytebase/terraform-provider-bytebase/blob/main/api/sql_review.go) to find supported rules.
185
-
-`level` (String) The SQL review rule level. Should be one of:
186
-
-`ERROR`
187
-
-`WARNING`
188
-
-`DISABLED`
189
-
-`payload` (Object) The payload for SQL review rule.
213
+
-`rules` (List of Object) List of SQL review rules.
214
+
215
+
The rule should a object contains:
216
+
217
+
-`type` (String) The SQL review rule type. You can check the [code](https://github.com/bytebase/terraform-provider-bytebase/blob/main/api/sql_review.go) to find supported rules.
218
+
-`level` (String) The SQL review rule level. Should be one of:
219
+
-`ERROR`
220
+
-`WARNING`
221
+
-`DISABLED`
222
+
-`payload` (Object) The payload for SQL review rule.
190
223
191
224
Please check the doc for details: https://www.bytebase.com/docs/sql-review/review-rules/supported-rules
192
225
@@ -240,7 +273,12 @@ Rules to limit the naming format:
240
273
-`naming.index.idx`
241
274
-`naming.index.uk`
242
275
243
-
For naming format rules, we need to set the `payload` with `max_length` and `format` attributes. For example:
276
+
For naming format rules, we need to set the `payload` with `max_length` and `format` attributes.
277
+
278
+
-`max_length` (Number) Maximum length for the name.
279
+
-`format` (String) Naming format in regex string.
280
+
281
+
For example:
244
282
245
283
```terraform
246
284
resource "bytebase_policy" "sql_review" {
@@ -302,6 +340,8 @@ Rules to limit by a specific number.
302
340
303
341
For number limit rules, we need to set the `payload` with `number` attribute. For example:
304
342
343
+
-`number` (Number) The number limit.
344
+
305
345
```terraform
306
346
resource "bytebase_policy" "sql_review" {
307
347
type = "SQL_REVIEW"
@@ -332,6 +372,8 @@ Rules define the allow or disallow list.
332
372
333
373
For list limit rules, we need to set the `payload` with `list` attribute. For example:
334
374
375
+
-`list` (List of String) The allow or disallow list.
0 commit comments