Skip to content

docs: sync Terraform tutorial series to provider 3.17.1#1076

Open
adela-bytebase wants to merge 2 commits intomainfrom
docs/terraform-tutorials-sync-3-17-1
Open

docs: sync Terraform tutorial series to provider 3.17.1#1076
adela-bytebase wants to merge 2 commits intomainfrom
docs/terraform-tutorials-sync-3-17-1

Conversation

@adela-bytebase
Copy link
Copy Markdown
Contributor

Summary

Fix schema drift across all 8 parts of the Bytebase Terraform Provider tutorial series. The docs were written against older provider versions and several snippets no longer apply against 3.17.1 (invalid resources, removed fields, wrong CEL attribute names).

Changes by part

  • Part 1 (environments) — provider version 3.8.63.17.1; unified DISABLE_COPY_DATA + DATA_SOURCE_QUERY into DATA_QUERY / query_data_policy; removed the non-existent checkers { required_issue_approval, required_status_checks { plan_check_enforcement } } block
  • Part 3 (projects) — removed fields that no longer exist on bytebase_project (auto_enable_backup, allow_modify_statement, auto_resolve_issue); fixed notification_types to current Activity enum values
  • Part 4 (general settings) — removed the non-existent bytebase_risk resource; rewrote approval_flow to current schema (flow.roles = [list] + source + CEL condition like "request.risk >= 100")
  • Part 6 (users/groups) — migrated bytebase_user with type = "SERVICE_ACCOUNT" to separate bytebase_service_account + bytebase_workload_identity resources; dropped removed type field
  • Part 7 (access control) — dropped parent = "workspaces/-" (fails validation; parent defaults to workspace); updated bindings to use serviceAccount: / workloadIdentity: member prefixes
  • Part 8 (masking) — renamed MASKING_EXCEPTIONMASKING_EXEMPTION and nested fields; dropped deprecated actions; fixed classification schema (levels.level as Number, not levels.id); added resource. prefix to CEL conditions and fixed classification_level integer comparison

Test plan

  • ./docs/check-links.sh passes
  • Manually apply each Part's .tf snippet against a fresh Bytebase + provider 3.17.1 to confirm no schema errors
  • Spot-check the rendered MDX on the preview deploy

🤖 Generated with Claude Code

Fix schema drift across all 8 parts of the Bytebase Terraform Provider
tutorial series after months of provider evolution.

- Part 1: bump provider version 3.8.6 -> 3.17.1; unify DISABLE_COPY_DATA
  + DATA_SOURCE_QUERY into DATA_QUERY / query_data_policy; remove
  non-existent checkers block from rollout_policy
- Part 3: remove removed fields (auto_enable_backup, allow_modify_statement,
  auto_resolve_issue); fix notification_types to current Activity enum
  values (ISSUE_CREATED, ISSUE_APPROVAL_REQUESTED, PIPELINE_COMPLETED)
- Part 4: remove non-existent bytebase_risk resource; rewrite approval_flow
  to current schema (flow.roles list + source + CEL condition)
- Part 6: migrate SERVICE_ACCOUNT bytebase_user to bytebase_service_account
  + bytebase_workload_identity resources; drop removed type field
- Part 7: drop parent = "workspaces/-" (fails validation, parent defaults
  to current workspace); update bindings to serviceAccount: /
  workloadIdentity: member prefixes
- Part 8: rename MASKING_EXCEPTION -> MASKING_EXEMPTION and nested fields;
  drop deprecated actions field on exemptions; fix classification schema
  (levels.level as Number, not levels.id); prefix CEL conditions with
  resource. and use integer comparison for classification_level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 14, 2026 18:39
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bytebase-com Ready Ready Preview, Comment Apr 14, 2026 6:58pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Bytebase Terraform Provider tutorial series to match provider v3.17.1 by removing/rewriting drifted schema fields and updating example snippets (resources, enums, and CEL attributes).

Changes:

  • Update Part 1 environment examples to provider 3.17.1, simplify rollout policy, and migrate data protection policy to DATA_QUERY / query_data_policy.
  • Update Part 4 general settings to the current approval flow schema (flow.roles + source + CEL condition) and remove the non-existent risk resource section.
  • Update Parts 6–8 tutorials for the new identity model (service accounts + workload identities), IAM member prefixes, and masking exemption/classification schema changes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/tutorials/manage-users-and-groups-with-terraform.mdx Introduces bytebase_service_account + bytebase_workload_identity and updates the user-management narrative/snippets.
docs/tutorials/manage-projects-with-terraform.mdx Updates bytebase_project example to current fields and notification enum values.
docs/tutorials/manage-general-settings-with-terraform.mdx Rewrites approval flow section to current schema and removes risk-policy content.
docs/tutorials/manage-environments-with-terraform.mdx Bumps provider version and updates rollout/data policies to current schema.
docs/tutorials/manage-database-access-control-with-terraform.mdx Updates IAM dependencies and member prefixes for service accounts/workload identities.
docs/tutorials/manage-data-masking-with-terraform.mdx Updates classification schema types, CEL conditions, and renames masking exception → exemption.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/tutorials/manage-data-masking-with-terraform.mdx
Comment thread docs/tutorials/manage-users-and-groups-with-terraform.mdx
Comment thread docs/tutorials/manage-database-access-control-with-terraform.mdx
Comment thread docs/tutorials/manage-data-masking-with-terraform.mdx
Comment thread docs/tutorials/manage-projects-with-terraform.mdx
@mintlify
Copy link
Copy Markdown
Contributor

mintlify bot commented Apr 14, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
bytebase-doc 🟢 Ready View Preview Apr 14, 2026, 6:49 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

- Part 6: clarify bytebase_service_account adopts the Part 1 bootstrap account
- Part 7: move tf service account to workspaceAdmin to prevent self-demotion
- Part 8: rename 'Masking Exceptions' to 'Masking Exemptions' for consistency
Copy link
Copy Markdown
Contributor

@ecmadao ecmadao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There're many duplicate TF examples in different repos, maybe we can consider give a link to the https://github.com/bytebase/terraform-provider-bytebase/tree/main/tutorials?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants