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
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.
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
bindwhich would default to true.This is how it would look for a schema resource:
Setting
bind: falsewould 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: