terraform-provider-databricks
terraform-provider-databricks copied to clipboard
[FEATURE] Add `databricks_recipients` Data Sources
Use-cases
Between 2 workspaces, it is only allowed to have one recipient, but multiple shares. When creating a share, users normally also attempt to create a recipient assuming there are non existing recipient. So quite often, we receive broken deployment that complaining an existing recipient is already created.
Attempted Solutions
To avoid this issue, a data source api can be used to allow users to query existing recipients and only create when certain recipient dose not exist.
Proposal
data "databricks_recipients" "this" {}
output "recipient_name" {
value = data.databricks_recipients.this.recipients
...
}
References
https://docs.databricks.com/api/workspace/recipients/list https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/shares