Terraform databricks labs provider

474 views Asked by At

I have an issue with terraform databricks labs provider, the below code give me an error "status 400: err Response from server {"error_code":"INVALID_PARAMETER_VALUE","message":"Path must be absolute: databricks"} " There is nothing in documentation about path parameter, I tried without "dbfs:" bit it did not like it as well ? Any help would be welcome.

resource "databricks_dbfs_file" "log4j_files" {
  content = filebase64("${path.module}/log.txt")
  path = "dbfs://databricks/spark-log"
  overwrite = true
  mkdirs = true
  validate_remote_file = true
}
2

There are 2 answers

3
T.H. On

The path parameter needs to include the filename.

Here's the documentation you'll need as well: https://registry.terraform.io/providers/databrickslabs/databricks/latest/docs/resources/dbfs_file

2
nefo_x On

Please make sure to use the latest version. Format of error message suggests you're using something before version 0.2.3.

Please do use source syntax of dbfs file resource, as shown this example for integration tests:

resource "databricks_dbfs_file" "show_variables" {
  source = "${path.module}/log.txt"
  path = "dbfs:/path/to/log.txt"
}