Support for data sources

Open
#3,460 2 comments 4 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
go, terraform
Domain
cli, devops

Research direction

Start by tracing how DAB resource definitions are handled and compare the proposed bind syntax with Terraform data-source behavior. Resolve whether bind or a separate sources concept is intended, then define the ownership and comparison rules and verify them with schema examples such as the bronze resource.

Written by the indexing model from the issue text.

Description

DABs Enhancement No Autoclose

In Terraform, you can declare a data source which is essentially a resource that is externally managed, but must exist.

The Databricks Terraform provider already supports this for a number of resources including schemas, e.g.

data "databricks_schemas" "sandbox" {
  catalog_name = "sandbox"
}

DABs should use this to support defining resources such as schemas that are required to exist in the catalog, but which aren't managed by the bundle.

The motivation is that sometimes we want to reference resources without having the bundle own them (for example schemas).

Syntax

We could introduce a property bind which would default to true.

This is how it would look for a schema resource:

resources:
  schemas:
    bronze:
      bind: false
      name: bronze
      catalog_name: dev

Setting bind: false would mean that the resource should already exist and we'll compare the resource data to the definition.

An alternative would be to introduce a concept of sources which would be in addition to resources. This would allow these sources to be specified by name without a complete definition, similar to Terraform's data sources:

sources:
  schemas:
    bronze:
      name: bronze
      catalog_name: dev
Dominant language
Go
Stars
427
Forks
267
Avg merge
2d 1h
Merged PRs (30d)
233

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

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.

More from databricks/cli

All issues in databricks/cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.