databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
450 stars 386 forks source link

[FEATURE] Default, provider-level tags #3781

Open nchammas opened 3 months ago

nchammas commented 3 months ago

Use-cases

Most of our team uses Databricks predominantly via its web UI. As we start to migrate some of our Databricks resources to be managed via Terraform, it will be difficult for people looking at the web UI to tell whether the resource they're looking at -- whether a job, cluster, or something else -- is meant to be managed directly in the UI or via Terraform.

Several resources, like jobs, allow you to tag them:

Screenshot 2024-07-16 at 1 08 40 PM

However, you have to do this for each resource.

There is no way to set at the Terraform provider level that you would like all resources, where possible, to be tagged with the same set of default tags like terraform: project-name. Default tags would make it easy for us to differentiate Terraform-managed resources from the rest in the Databricks UI.

Attempted Solutions

As far as I can tell, there is no way to specify default tags at the provider level.

Proposal

Roughly mirror the default_tags feature of the AWS Terraform provider.

provider "databricks" {
  default_tags {
    managed_by  = "terraform"
    terraform   = "project-name"
    environment = "test"
  }
}

References

Related: https://github.com/databricks/terraform-provider-databricks/issues/2236

Ajaylagishetty commented 2 weeks ago

is there any update on adding the tags for catalog and schema? something like this works as well https://github.com/databricks/terraform-provider-databricks/issues/2236