Skip to content

Commit 619e80d

Browse files
authored
chore: support more environment policy (#124)
* chore: support more environment policy * fix: lint
1 parent f14dde2 commit 619e80d

File tree

28 files changed

+481
-71
lines changed

28 files changed

+481
-71
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.8.0
1+
3.8.1

docs/data-sources/policy.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@ The policy data source.
1717

1818
### Required
1919

20+
- `parent` (String) The policy parent name for the policy, support projects/{resource id}, environments/{resource id}, instances/{resource id}, or instances/{resource id}/databases/{database name}
2021
- `type` (String) The policy type.
2122

2223
### Optional
2324

25+
- `data_source_query_policy` (Block List, Max: 1) Restrict querying admin data sources (see [below for nested schema](#nestedblock--data_source_query_policy))
26+
- `disable_copy_data_policy` (Block List, Max: 1) Restrict data copying in SQL Editor (Admins/DBAs allowed) (see [below for nested schema](#nestedblock--disable_copy_data_policy))
2427
- `global_masking_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--global_masking_policy))
2528
- `masking_exception_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--masking_exception_policy))
26-
- `parent` (String) The policy parent name for the policy, support projects/{resource id}, environments/{resource id}, instances/{resource id}, or instances/{resource id}/databases/{database name}
29+
- `rollout_policy` (Block List, Max: 1) Control issue rollout. Learn more: https://docs.bytebase.com/administration/environment-policy/rollout-policy (see [below for nested schema](#nestedblock--rollout_policy))
2730

2831
### Read-Only
2932

@@ -32,6 +35,24 @@ The policy data source.
3235
- `inherit_from_parent` (Boolean) Decide if the policy should inherit from the parent.
3336
- `name` (String) The policy full name
3437

38+
<a id="nestedblock--data_source_query_policy"></a>
39+
### Nested Schema for `data_source_query_policy`
40+
41+
Optional:
42+
43+
- `disallow_ddl` (Boolean) Disallow running DDL statements in the SQL editor.
44+
- `disallow_dml` (Boolean) Disallow running DML statements in the SQL editor.
45+
- `restriction` (String) RESTRICTION_UNSPECIFIED means no restriction; FALLBACK will allows to query admin data sources when there is no read-only data source; DISALLOW will always disallow to query admin data sources.
46+
47+
48+
<a id="nestedblock--disable_copy_data_policy"></a>
49+
### Nested Schema for `disable_copy_data_policy`
50+
51+
Required:
52+
53+
- `enable` (Boolean) Restrict data copying
54+
55+
3556
<a id="nestedblock--global_masking_policy"></a>
3657
### Nested Schema for `global_masking_policy`
3758

@@ -74,3 +95,13 @@ Optional:
7495
- `table` (String)
7596

7697

98+
99+
<a id="nestedblock--rollout_policy"></a>
100+
### Nested Schema for `rollout_policy`
101+
102+
Optional:
103+
104+
- `automatic` (Boolean) If all check pass, the change will be rolled out and executed automatically.
105+
- `roles` (Set of String) If any roles are specified, Bytebase requires users with those roles to manually roll out the change.
106+
107+

docs/data-sources/setting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The setting data source.
2222
### Optional
2323

2424
- `classification` (Block List, Max: 1) Classification for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--classification))
25-
- `semantic_types` (Block Set) Semantic types for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--semantic_types))
25+
- `semantic_types` (Block List) Semantic types for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--semantic_types))
2626
- `workspace_profile` (Block List, Max: 1) (see [below for nested schema](#nestedblock--workspace_profile))
2727

2828
### Read-Only
@@ -38,7 +38,7 @@ Required:
3838

3939
- `classifications` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--classifications))
4040
- `id` (String) The classification unique uuid.
41-
- `levels` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--levels))
41+
- `levels` (Block List, Min: 1) (see [below for nested schema](#nestedblock--classification--levels))
4242
- `title` (String) The classification title. Optional.
4343

4444
Optional:

docs/resources/environment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ The environment resource.
1717

1818
### Required
1919

20-
- `order` (Number) The environment sorting order.
2120
- `resource_id` (String) The environment unique id.
2221
- `title` (String) The environment display name.
2322

2423
### Optional
2524

2625
- `color` (String) The environment color.
26+
- `order` (Number) The environment sorting order.
2727
- `protected` (Boolean) The environment is protected or not.
2828

2929
### Read-Only

docs/resources/policy.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,37 @@ The policy resource.
2222

2323
### Optional
2424

25+
- `data_source_query_policy` (Block List, Max: 1) Restrict querying admin data sources (see [below for nested schema](#nestedblock--data_source_query_policy))
26+
- `disable_copy_data_policy` (Block List, Max: 1) Restrict data copying in SQL Editor (Admins/DBAs allowed) (see [below for nested schema](#nestedblock--disable_copy_data_policy))
2527
- `enforce` (Boolean) Decide if the policy is enforced.
2628
- `global_masking_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--global_masking_policy))
2729
- `inherit_from_parent` (Boolean) Decide if the policy should inherit from the parent.
2830
- `masking_exception_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--masking_exception_policy))
31+
- `rollout_policy` (Block List, Max: 1) Control issue rollout. Learn more: https://docs.bytebase.com/administration/environment-policy/rollout-policy (see [below for nested schema](#nestedblock--rollout_policy))
2932

3033
### Read-Only
3134

3235
- `id` (String) The ID of this resource.
3336
- `name` (String) The policy full name
3437

38+
<a id="nestedblock--data_source_query_policy"></a>
39+
### Nested Schema for `data_source_query_policy`
40+
41+
Optional:
42+
43+
- `disallow_ddl` (Boolean) Disallow running DDL statements in the SQL editor.
44+
- `disallow_dml` (Boolean) Disallow running DML statements in the SQL editor.
45+
- `restriction` (String) RESTRICTION_UNSPECIFIED means no restriction; FALLBACK will allows to query admin data sources when there is no read-only data source; DISALLOW will always disallow to query admin data sources.
46+
47+
48+
<a id="nestedblock--disable_copy_data_policy"></a>
49+
### Nested Schema for `disable_copy_data_policy`
50+
51+
Required:
52+
53+
- `enable` (Boolean) Restrict data copying
54+
55+
3556
<a id="nestedblock--global_masking_policy"></a>
3657
### Nested Schema for `global_masking_policy`
3758

@@ -74,3 +95,13 @@ Optional:
7495
- `table` (String)
7596

7697

98+
99+
<a id="nestedblock--rollout_policy"></a>
100+
### Nested Schema for `rollout_policy`
101+
102+
Optional:
103+
104+
- `automatic` (Boolean) If all check pass, the change will be rolled out and executed automatically.
105+
- `roles` (Set of String) If any roles are specified, Bytebase requires users with those roles to manually roll out the change.
106+
107+

docs/resources/setting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The setting resource.
2424
- `approval_flow` (Block List) Configure risk level and approval flow for different tasks. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--approval_flow))
2525
- `classification` (Block List, Max: 1) Classification for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--classification))
2626
- `environment_setting` (Block List) The environment (see [below for nested schema](#nestedblock--environment_setting))
27-
- `semantic_types` (Block Set) Semantic types for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--semantic_types))
27+
- `semantic_types` (Block List) Semantic types for data masking. Require ENTERPRISE subscription. (see [below for nested schema](#nestedblock--semantic_types))
2828
- `workspace_profile` (Block List, Max: 1) (see [below for nested schema](#nestedblock--workspace_profile))
2929

3030
### Read-Only
@@ -88,7 +88,7 @@ Required:
8888

8989
- `classifications` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--classifications))
9090
- `id` (String) The classification unique uuid.
91-
- `levels` (Block Set, Min: 1) (see [below for nested schema](#nestedblock--classification--levels))
91+
- `levels` (Block List, Min: 1) (see [below for nested schema](#nestedblock--classification--levels))
9292
- `title` (String) The classification title. Optional.
9393

9494
Optional:

examples/database/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
terraform {
33
required_providers {
44
bytebase = {
5-
version = "3.7.2"
5+
version = "3.8.1"
66
# For local development, please use "terraform.local/bytebase/bytebase" instead
77
source = "registry.terraform.io/bytebase/bytebase"
88
}

examples/database_group/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "3.7.2"
4+
version = "3.8.1"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}

examples/environments/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "3.7.2"
4+
version = "3.8.1"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}

examples/groups/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
terraform {
22
required_providers {
33
bytebase = {
4-
version = "3.7.2"
4+
version = "3.8.1"
55
# For local development, please use "terraform.local/bytebase/bytebase" instead
66
source = "registry.terraform.io/bytebase/bytebase"
77
}

0 commit comments

Comments
 (0)