bytebase / bytebase/terraform-provider-bytebase

[FEAT] Support table-level resource scope to handle large database catalogs

Open
#210 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
11
Forks
10
Avg merge
2d 18h
Merged PRs (30d)
5

Description

Summary

Currently, in the Terraform Provider for Bytebase, all schemas, tables, and column configurations must be defined inside the nested catalog block within the single bytebase_database resource.

When managing large-scale databases with a high volume of tables and columns, the configuration for a single bytebase_database resource becomes excessively large, causing significant operational challenges.

Problem
  1. Performance degradation during terraform plan / apply
  • Because the entire database is managed as a single resource, modifying even a single table requires reviewing and comparing the state for the entire database catalog, leading to high execution times.
  1. Reduced diff readability and larger blast radius
  • When multiple team members make changes to different tables simultaneously, code reviews become difficult due to high contention on the same resource, increasing the risk of merge conflicts and human error.
  1. Maintainability issues
  • Single resource blocks expand to thousands or tens of thousands of lines of code, making the configuration file hard to read and navigate.
Feature Request

We request the ability to define resources at the table level, or to scope terraform plan / apply operations to individual tables.

For example, introducing an independent resource structure such as:

# Database instance resource
resource "bytebase_database" "liberty" {
  name        = "instances/prod-aurora-liberty-reader/databases/liberty"
  project     = "projects/liberty"
  environment = "environments/prod"
}

# Table-level resource definition
resource "bytebase_table" "account_statement" {
  database = bytebase_database.liberty.id
  schema   = "lib"
  name     = "account_statement_create_date_latest"

  column {
    name           = "account_statement_create_date_latest_id"
    classification = "1-1"
  }
}

Expected Impact
  • Allows targeted executions (e.g., using terraform plan -target=...) per table to minimize the impact zone.
  • Reduces overall CI/CD pipeline execution time.
  • Enables easier modularization across files and pull requests, boosting team productivity and safe concurrent workflows.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Terraform provider's existing bytebase_database resource and its nested catalog structure. Determine how an independent bytebase_table resource could reference the database while preserving schema, table, and column configuration. Done means table-level definitions can be planned and applied independently without requiring the full database catalog in one resource.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, terraform
Domain
infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.