Open terrymunro opened 5 months ago
Hi @terrymunro, thanks for reaching out. We will take a look.
We are also having this issue. databricks_file
does not detect when the source file has changed.
Thank you for your help on this issue :)
It looks like this might be fixed with https://github.com/databricks/terraform-provider-databricks/pull/3662
This is also an issue with the databricks_global_init_script
resource but I don't think the above PR will fix the init script resource. The md5
attribute trick mentioned above works around the issue though.
Configuration
Expected Behavior
The
md5
attribute should be populated with the md5 hash of the source file for both resources.Actual Behavior
It is only populated for
databricks_workspace_file
.On the first apply both
md5
attribute show as the default "different".Changing the file and re-applying, the
databricks_workspace_file
shows a change on themd5
attribute from the md5 of the file to "different", butdatabricks_file
does not detect any change.In both resources it's logging the
md5
correctly, but onlydatabricks_workspace_file
is saving the md5 hash to state. It shows in the diff as "different".Steps to Reproduce
echo '#!/bin/bash\n\necho "Hello World"' > hello.sh
terraform apply
Terraform and provider versions
Is it a regression?
No.
databricks_file
resource was only released in the latest (v1.37.0) version.Debug Output
After changing the file and re-apply:
Important Factoids
3265
databricks_workspace_file
reads function: workspace/file_resource.go#L36databricks_file
read function: storage/resource_file.go#L16For now, you can get around this by manually setting the
md5
attribute, but the attribute is not documented: