Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using Terraform Bytebase Provider to prepare those instances ready for applicati

- [Go](https://golang.org/doc/install) (1.19 or later)
- [Terraform](https://developer.hashicorp.com/terraform/downloads?product_intent=terraform) (1.3.5 or later)
- [Bytebase](https://github.com/bytebase/bytebase) (3.10.0 or later)
- [Bytebase](https://github.com/bytebase/bytebase) (3.11.1 or later)

> If you have problems running `terraform` in MacOS with Apple Silicon, you can following https://stackoverflow.com/questions/66281882/how-can-i-get-terraform-init-to-run-on-my-apple-silicon-macbook-pro-for-the-go and use the `tfenv`.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.0
3.11.1
1 change: 0 additions & 1 deletion docs/data-sources/iam_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Optional:

- `database` (String) The accessible database full name in instances/{instance resource id}/databases/{database name} format
- `expire_timestamp` (String) The expiration timestamp in YYYY-MM-DDThh:mm:ssZ format
- `row_limit` (Number) The export row limit for exporter role
- `schema` (String) The accessible schema in the database
- `tables` (Set of String) The accessible table list

Expand Down
15 changes: 2 additions & 13 deletions docs/data-sources/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The policy data source.
### Optional

- `data_source_query_policy` (Block List, Max: 1) Restrict querying admin data sources (see [below for nested schema](#nestedblock--data_source_query_policy))
- `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))
- `global_masking_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--global_masking_policy))
- `masking_exception_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--masking_exception_policy))
- `query_data_policy` (Block List, Max: 1) The policy for query data (see [below for nested schema](#nestedblock--query_data_policy))
Expand All @@ -46,14 +45,6 @@ Optional:
- `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.


<a id="nestedblock--disable_copy_data_policy"></a>
### Nested Schema for `disable_copy_data_policy`

Required:

- `enable` (Boolean) Restrict data copying


<a id="nestedblock--global_masking_policy"></a>
### Nested Schema for `global_masking_policy`

Expand Down Expand Up @@ -106,12 +97,10 @@ Optional:
<a id="nestedblock--query_data_policy"></a>
### Nested Schema for `query_data_policy`

Required:

- `disable_export` (Boolean) Disable export data in the SQL editor

Optional:

- `disable_copy_data` (Boolean) Disable copying data in the SQL editor
- `disable_export` (Boolean) Disable export data in the SQL editor
- `maximum_result_rows` (Number) The return rows limit. If the value <= 0, will be treated as no limit. The default value is -1.
- `maximum_result_size` (Number) The size limit in bytes. The default value is 100MB, we will use the default value if the limit <= 0.
- `timeout_in_seconds` (Number) The maximum time allowed for a query to run in SQL Editor. No limit when the value <= 0
Expand Down
10 changes: 1 addition & 9 deletions docs/data-sources/policy_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ The policy data source list.
Read-Only:

- `data_source_query_policy` (List of Object) (see [below for nested schema](#nestedobjatt--policies--data_source_query_policy))
- `disable_copy_data_policy` (List of Object) (see [below for nested schema](#nestedobjatt--policies--disable_copy_data_policy))
- `enforce` (Boolean)
- `global_masking_policy` (List of Object) (see [below for nested schema](#nestedobjatt--policies--global_masking_policy))
- `inherit_from_parent` (Boolean)
Expand All @@ -50,14 +49,6 @@ Read-Only:
- `restriction` (String)


<a id="nestedobjatt--policies--disable_copy_data_policy"></a>
### Nested Schema for `policies.disable_copy_data_policy`

Read-Only:

- `enable` (Boolean)


<a id="nestedobjatt--policies--global_masking_policy"></a>
### Nested Schema for `policies.global_masking_policy`

Expand Down Expand Up @@ -106,6 +97,7 @@ Read-Only:

Read-Only:

- `disable_copy_data` (Boolean)
- `disable_export` (Boolean)
- `maximum_result_rows` (Number)
- `maximum_result_size` (Number)
Expand Down
10 changes: 1 addition & 9 deletions docs/data-sources/setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,9 @@ Read-Only:
Read-Only:

- `description` (String)
- `steps` (List of Object) (see [below for nested schema](#nestedobjatt--approval_flow--rules--flow--steps))
- `roles` (List of String)
- `title` (String)

<a id="nestedobjatt--approval_flow--rules--flow--steps"></a>
### Nested Schema for `approval_flow.rules.flow.title`

Read-Only:

- `role` (String)





Expand Down
1 change: 0 additions & 1 deletion docs/resources/iam_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Optional:

- `database` (String) The accessible database full name in instances/{instance resource id}/databases/{database name} format
- `expire_timestamp` (String) The expiration timestamp in YYYY-MM-DDThh:mm:ssZ format
- `row_limit` (Number) The export row limit for exporter role
- `schema` (String) The accessible schema in the database
- `tables` (Set of String) The accessible table list

Expand Down
15 changes: 2 additions & 13 deletions docs/resources/policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ The policy resource.
### Optional

- `data_source_query_policy` (Block List, Max: 1) Restrict querying admin data sources (see [below for nested schema](#nestedblock--data_source_query_policy))
- `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))
- `enforce` (Boolean) Decide if the policy is enforced.
- `global_masking_policy` (Block List, Max: 1) (see [below for nested schema](#nestedblock--global_masking_policy))
- `inherit_from_parent` (Boolean) Decide if the policy should inherit from the parent.
Expand All @@ -46,14 +45,6 @@ Optional:
- `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.


<a id="nestedblock--disable_copy_data_policy"></a>
### Nested Schema for `disable_copy_data_policy`

Required:

- `enable` (Boolean) Restrict data copying


<a id="nestedblock--global_masking_policy"></a>
### Nested Schema for `global_masking_policy`

Expand Down Expand Up @@ -106,12 +97,10 @@ Optional:
<a id="nestedblock--query_data_policy"></a>
### Nested Schema for `query_data_policy`

Required:

- `disable_export` (Boolean) Disable export data in the SQL editor

Optional:

- `disable_copy_data` (Boolean) Disable copying data in the SQL editor
- `disable_export` (Boolean) Disable export data in the SQL editor
- `maximum_result_rows` (Number) The return rows limit. If the value <= 0, will be treated as no limit. The default value is -1.
- `maximum_result_size` (Number) The size limit in bytes. The default value is 100MB, we will use the default value if the limit <= 0.
- `timeout_in_seconds` (Number) The maximum time allowed for a query to run in SQL Editor. No limit when the value <= 0
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/risk.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The risk resource. Require ENTERPRISE subscription. Check the docs https://www.b
### Required

- `condition` (String) The risk condition. Check the proto message https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/risk_service.proto#L210 for details.
- `level` (Number) The risk level, should be 300, 200 or 100. Higher number means higher level.
- `level` (String) The risk level. Check https://github.com/bytebase/bytebase/blob/fd87c6bfe8a0d4883f25eb480a3b05ed3c2e1727/proto/v1/v1/common.proto#L93 for details
- `source` (String) The risk source. Check https://github.com/bytebase/bytebase/blob/main/proto/v1/v1/risk_service.proto#L138 for details
- `title` (String) The risk title.

Expand Down
10 changes: 1 addition & 9 deletions docs/resources/setting.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,13 @@ Optional:

Required:

- `steps` (Block List, Min: 1) Approval flow following the step order. (see [below for nested schema](#nestedblock--approval_flow--rules--flow--steps))
- `roles` (List of String) The role require to review in this step
- `title` (String)

Optional:

- `description` (String)

<a id="nestedblock--approval_flow--rules--flow--steps"></a>
### Nested Schema for `approval_flow.rules.flow.steps`

Required:

- `role` (String) The role require to review in this step



<a id="nestedblock--approval_flow--rules--conditions"></a>
### Nested Schema for `approval_flow.rules.conditions`
Expand Down
2 changes: 1 addition & 1 deletion examples/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/database_group/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down Expand Up @@ -36,7 +36,7 @@ resource "bytebase_database_group" "databases_in_test" {
resource_id = "databases-in-test"
project = data.bytebase_project.sample_project.name
title = "Databases in test env"
condition = "resource.environment_name == \"test\""
condition = "resource.environment_id == \"test\""
}

data "bytebase_database_group" "databases_in_test" {
Expand Down
2 changes: 1 addition & 1 deletion examples/environments/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/groups/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/iamPolicy/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/instances/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/policies/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/projects/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/risk/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/roles/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/settings/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
16 changes: 5 additions & 11 deletions examples/setup/approval_flow.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ resource "bytebase_setting" "approval_flow" {
description = "Need DBA and workspace admin approval"

# Approval flow following the step order.
steps {
role = "roles/projectOwner"
}

steps {
role = "roles/workspaceDBA"
}

steps {
role = "roles/workspaceAdmin"
}
roles = [
"roles/projectOwner",
"roles/workspaceDBA",
"roles/workspaceAdmin"
]
}

# Match any condition will trigger this approval flow.
Expand Down
2 changes: 1 addition & 1 deletion examples/setup/database_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ resource "bytebase_database_group" "databases_in_test" {
resource_id = "databases-in-test"
project = bytebase_project.sample_project.name
title = "Databases in test env"
condition = "resource.environment_name == \"test\""
condition = "resource.environment_id == \"test\""
}
8 changes: 4 additions & 4 deletions examples/setup/environment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ resource "bytebase_policy" "rollout_policy" {
}
}

resource "bytebase_policy" "disable_copy_data_policy" {
resource "bytebase_policy" "env_query_data_policy" {
depends_on = [bytebase_setting.environments]
parent = bytebase_setting.environments.environment_setting[0].environment[0].name
type = "DISABLE_COPY_DATA"
type = "DATA_QUERY"

disable_copy_data_policy {
enable = false
query_data_policy {
disable_copy_data = true
}
}

Expand Down
1 change: 0 additions & 1 deletion examples/setup/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ resource "bytebase_iam_policy" "project_iam" {
condition {
database = "instances/test-sample-instance/databases/employee"
tables = ["dept_emp", "dept_manager"]
row_limit = 10000
expire_timestamp = "2027-03-09T16:17:49Z"
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/setup/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/setup/risk.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "bytebase_risk" "risk" {
title = "Risk for prod environment"
source = "DML"
level = 300
level = "HIGH"
active = true
condition = "resource.environment_id == \"prod\" && statement.affected_rows >= 100"
}
2 changes: 1 addition & 1 deletion examples/sql_review/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/users/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
terraform {
required_providers {
bytebase = {
version = "3.10.0"
version = "3.11.1"
# For local development, please use "terraform.local/bytebase/bytebase" instead
source = "registry.terraform.io/bytebase/bytebase"
}
Expand Down
Loading