3

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
}
Alex Ott
  • 80,552
  • 8
  • 87
  • 132
Kylo
  • 109
  • 8

2 Answers2

2

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"
}
nefo_x
  • 3,050
  • 4
  • 27
  • 40
1

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

T.H.
  • 819
  • 5
  • 4
  • I know I did check it but it is not working, at least the version I have. I will have to get my hands dirty and check in source code, – Kylo Sep 23 '20 at 15:45
  • Does the path format shown in the documentation not work? I believe you'll also need the content_b64_md5 argument. – T.H. Sep 23 '20 at 17:21
  • When I add content_b64_md5 it throws an error, It must be something with the version. It is very buggy. – Kylo Sep 25 '20 at 07:50