From 2a20b7c71522ead29fb1086a5da00ffc4a83654c Mon Sep 17 00:00:00 2001 From: adela Date: Thu, 16 Apr 2026 10:40:46 +0200 Subject: [PATCH 1/4] docs(tutorials): fix project settings and classification levels - 3-projects.tf: Replace removed fields (allow_modify_statement, auto_resolve_issue, auto_enable_backup) with current schema fields (allow_just_in_time_access, force_issue_labels) - 8-2-classification.tf: Add missing level field to top-level classifications (id "1" and "2") Co-Authored-By: Claude Opus 4.6 --- tutorials/3-projects.tf | 4 +++- tutorials/8-2-classification.tf | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tutorials/3-projects.tf b/tutorials/3-projects.tf index d63d686..e381d7d 100644 --- a/tutorials/3-projects.tf +++ b/tutorials/3-projects.tf @@ -8,8 +8,10 @@ resource "bytebase_project" "project-one" { enforce_sql_review = true require_issue_approval = true - require_plan_check_no_error = false + require_plan_check_no_error = true allow_request_role = true + allow_just_in_time_access = true + force_issue_labels = false # Issue labels issue_labels { diff --git a/tutorials/8-2-classification.tf b/tutorials/8-2-classification.tf index a4819c7..e1cff51 100644 --- a/tutorials/8-2-classification.tf +++ b/tutorials/8-2-classification.tf @@ -17,6 +17,7 @@ resource "bytebase_setting" "classification" { classifications { id = "1" title = "Basic" + level = 1 } classifications { @@ -34,6 +35,7 @@ resource "bytebase_setting" "classification" { classifications { id = "2" title = "Employment" + level = 1 } classifications { From f09aa633b9e59f0b031a57657874205d2f1ae7e6 Mon Sep 17 00:00:00 2001 From: adela Date: Thu, 16 Apr 2026 10:58:40 +0200 Subject: [PATCH 2/4] docs(tutorials): bump provider version to 3.17.1 Co-Authored-By: Claude Opus 4.6 --- tutorials/0-provider.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/0-provider.tf b/tutorials/0-provider.tf index 84446c4..04b7030 100644 --- a/tutorials/0-provider.tf +++ b/tutorials/0-provider.tf @@ -1,7 +1,7 @@ terraform { required_providers { bytebase = { - version = "3.17.0" + version = "3.17.1" # For local development, please use "terraform.local/bytebase/bytebase" instead source = "registry.terraform.io/bytebase/bytebase" } From b3ec0ee040d04bf4e98d5ed50d7660818890c257 Mon Sep 17 00:00:00 2001 From: adela Date: Thu, 16 Apr 2026 11:31:04 +0200 Subject: [PATCH 3/4] style(tutorials): use underscores in Terraform resource labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rename project-one → project_one, project-two → project_two in resource labels to follow HashiCorp naming conventions. The resource_id values keep hyphens (Bytebase identifiers). Co-Authored-By: Claude Opus 4.6 --- tutorials/3-projects.tf | 4 ++-- tutorials/7-2-project-iam.tf | 2 +- tutorials/8-4-database-masking.tf | 4 ++-- tutorials/8-5-masking-exemption.tf | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tutorials/3-projects.tf b/tutorials/3-projects.tf index e381d7d..31dcb38 100644 --- a/tutorials/3-projects.tf +++ b/tutorials/3-projects.tf @@ -1,5 +1,5 @@ # Project One - with all new project settings -resource "bytebase_project" "project-one" { +resource "bytebase_project" "project_one" { depends_on = [ bytebase_instance.test ] @@ -46,7 +46,7 @@ resource "bytebase_project" "project-one" { } # Project Two - minimal configuration -resource "bytebase_project" "project-two" { +resource "bytebase_project" "project_two" { depends_on = [ bytebase_instance.prod ] diff --git a/tutorials/7-2-project-iam.tf b/tutorials/7-2-project-iam.tf index e612c78..f734057 100644 --- a/tutorials/7-2-project-iam.tf +++ b/tutorials/7-2-project-iam.tf @@ -5,7 +5,7 @@ resource "bytebase_iam_policy" "project_iam" { bytebase_user.workspace_dba2 ] - parent = bytebase_project.project-two.name + parent = bytebase_project.project_two.name iam_policy { diff --git a/tutorials/8-4-database-masking.tf b/tutorials/8-4-database-masking.tf index 4d646ae..7e2fe90 100644 --- a/tutorials/8-4-database-masking.tf +++ b/tutorials/8-4-database-masking.tf @@ -1,12 +1,12 @@ resource "bytebase_database" "database" { depends_on = [ bytebase_instance.prod, - bytebase_project.project-two, + bytebase_project.project_two, bytebase_setting.environments ] name = "instances/prod-sample-instance/databases/hr_prod" - project = bytebase_project.project-two.name + project = bytebase_project.project_two.name environment = bytebase_setting.environments.environment_setting[0].environment[1].name catalog { diff --git a/tutorials/8-5-masking-exemption.tf b/tutorials/8-5-masking-exemption.tf index a95d557..be7d7fa 100644 --- a/tutorials/8-5-masking-exemption.tf +++ b/tutorials/8-5-masking-exemption.tf @@ -1,10 +1,10 @@ resource "bytebase_policy" "masking_exemption_policy" { depends_on = [ - bytebase_project.project-two, + bytebase_project.project_two, bytebase_instance.prod ] - parent = bytebase_project.project-two.name + parent = bytebase_project.project_two.name type = "MASKING_EXEMPTION" enforce = true inherit_from_parent = false From e6bf276da6983ed6367c6b6b4f1c8fdb6125128e Mon Sep 17 00:00:00 2001 From: adela Date: Thu, 16 Apr 2026 11:31:11 +0200 Subject: [PATCH 4/4] Revert "style(tutorials): use underscores in Terraform resource labels" This reverts commit b3ec0ee040d04bf4e98d5ed50d7660818890c257. --- tutorials/3-projects.tf | 4 ++-- tutorials/7-2-project-iam.tf | 2 +- tutorials/8-4-database-masking.tf | 4 ++-- tutorials/8-5-masking-exemption.tf | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tutorials/3-projects.tf b/tutorials/3-projects.tf index 31dcb38..e381d7d 100644 --- a/tutorials/3-projects.tf +++ b/tutorials/3-projects.tf @@ -1,5 +1,5 @@ # Project One - with all new project settings -resource "bytebase_project" "project_one" { +resource "bytebase_project" "project-one" { depends_on = [ bytebase_instance.test ] @@ -46,7 +46,7 @@ resource "bytebase_project" "project_one" { } # Project Two - minimal configuration -resource "bytebase_project" "project_two" { +resource "bytebase_project" "project-two" { depends_on = [ bytebase_instance.prod ] diff --git a/tutorials/7-2-project-iam.tf b/tutorials/7-2-project-iam.tf index f734057..e612c78 100644 --- a/tutorials/7-2-project-iam.tf +++ b/tutorials/7-2-project-iam.tf @@ -5,7 +5,7 @@ resource "bytebase_iam_policy" "project_iam" { bytebase_user.workspace_dba2 ] - parent = bytebase_project.project_two.name + parent = bytebase_project.project-two.name iam_policy { diff --git a/tutorials/8-4-database-masking.tf b/tutorials/8-4-database-masking.tf index 7e2fe90..4d646ae 100644 --- a/tutorials/8-4-database-masking.tf +++ b/tutorials/8-4-database-masking.tf @@ -1,12 +1,12 @@ resource "bytebase_database" "database" { depends_on = [ bytebase_instance.prod, - bytebase_project.project_two, + bytebase_project.project-two, bytebase_setting.environments ] name = "instances/prod-sample-instance/databases/hr_prod" - project = bytebase_project.project_two.name + project = bytebase_project.project-two.name environment = bytebase_setting.environments.environment_setting[0].environment[1].name catalog { diff --git a/tutorials/8-5-masking-exemption.tf b/tutorials/8-5-masking-exemption.tf index be7d7fa..a95d557 100644 --- a/tutorials/8-5-masking-exemption.tf +++ b/tutorials/8-5-masking-exemption.tf @@ -1,10 +1,10 @@ resource "bytebase_policy" "masking_exemption_policy" { depends_on = [ - bytebase_project.project_two, + bytebase_project.project-two, bytebase_instance.prod ] - parent = bytebase_project.project_two.name + parent = bytebase_project.project-two.name type = "MASKING_EXEMPTION" enforce = true inherit_from_parent = false