Skip to content

Commit 165e2e9

Browse files
committed
Deprecated redundant fields for notebook and file
* `databricks_notebook` & `databricks_dbfs_file` field `content` is deprecated and would be renamed to `content_base64` to further increase clarity. * `databricks_dbfs_file` has got `content`, `content_b64_md5`, `overwrite`, `mkdirs`, `validate_remote_file` fields deprecated and they will be removed in the next version, where critical code path will be shared with `databricks_notebook`.
1 parent d0683f7 commit 165e2e9

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
* Fixed documentation issues.
66
* Added missing resource importers and test to cover it.
77
* Migrated build from TravisCI to GitHub Actions.
8+
* Fixed custom `config_file` issue configuration handling ([#420](https://github.com/databrickslabs/terraform-provider-databricks/issues/420)).
89

910
**Deprecations**
1011
* `databricks_notebook` has got `overwrite`, `mkdirs` and `format` parameters, that always have to be set to certain values in order to follow expected behavior of terraform. These fields would be removed in 0.3 and always set to proper values.
12+
* `databricks_notebook` & `databricks_dbfs_file` field `content` is deprecated and would be renamed to `content_base64` to further increase clarity.
13+
* `databricks_dbfs_file` has got `content`, `content_b64_md5`, `overwrite`, `mkdirs`, `validate_remote_file` fields deprecated and they will be removed in the next version, where critical code path will be shared with `databricks_notebook`.
1114
* `network_error_messages` and `verify_workspace_runnning` from `databricks_mws_workspaces` is deprecated and going to be removed in 0.3.
1215
* `error_messages` from `databricks_mws_networks` are deprecated and would be removed in 0.3.
1316
* `ebs_volume_type` and `azure_disk_volume_type` from `databricks_instance_pool` is going to be moved to `disk_type` sub-block in 0.3, which means you'll slightly have to modify configuration while migrating to 0.3. Computed field `default_tags` is going to be removed from resource. This is done to further increase maintainability of provider in the future.

docs/resources/dbfs_file.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ resource "databricks_dbfs_file" "my_dbfs_file" {
3535

3636
The following arguments are supported:
3737

38-
* `content` - (Optional) The content of the file as a base64 encoded string.
38+
* `content` - (Optional) The content of the file as a base64 encoded string. **This field is deprecated and would be removed in the next version.**
3939
* `source` - (Optional) The full absolute path to the file. Please use [pathexpand](https://www.terraform.io/docs/configuration/functions/pathexpand.html).
40-
* `content_b64_md5` - (Required) The checksum for the content please use the [md5](https://www.terraform.io/docs/configuration/functions/md5.html) and [filebase64](https://www.terraform.io/docs/configuration/functions/filebase64.html) functions in terraform to retrieve the checksum.
40+
* `content_b64_md5` - (Required) The checksum for the content please use the [md5](https://www.terraform.io/docs/configuration/functions/md5.html) and [filebase64](https://www.terraform.io/docs/configuration/functions/filebase64.html) functions in terraform to retrieve the checksum. **This field is deprecated and would be removed in the next version.**
4141
* `path` - (Required) The path of the file in which you wish to save.
42-
* `overwrite` - (Optional) This is used to determine whether it should delete the existing file with the same name when it writes. The default is set to false.
43-
* `mkdirs` - (Optional) When the resource is created, this field is used to determine if it needs to make the parent directories. The default value is set to true.
44-
* `validate_remote_file` - (Optional) This is used to compare the actual contents of the file to determine if the remote file is valid or not. If the base64 content is different
45-
it will attempt to do a delete, create.
42+
* `overwrite` - (Optional) This is used to determine whether it should delete the existing file with the same name when it writes. The default is set to false. **This field is deprecated and would be removed in the next version.**
43+
* `mkdirs` - (Optional) When the resource is created, this field is used to determine if it needs to make the parent directories. The default value is set to true. **This field is deprecated and would be removed in the next version.**
44+
* `validate_remote_file` - (Optional) This is used to compare the actual contents of the file to determine if the remote file is valid or not. If the base64 content is different it will attempt to do a delete, create. **This field is deprecated and would be removed in the next version.**
4645

4746

4847
## Attribute Reference

docs/resources/notebook.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ resource "databricks_notebook" "notebook" {
2626

2727
The following arguments are supported:
2828

29-
* `content` - (Required) The base64-encoded content. If the limit (10MB) is exceeded, an exception with error code MAX_NOTEBOOK_SIZE_EXCEEDED will be thrown.
30-
* `path` - (Required) The absolute path of the notebook or directory, beginning with "/", e.g. "/mynotebook". This field is **required**.
31-
* `language` - (Required) The language. If format is set to SOURCE, this field is required; otherwise, it will be ignored. Possible choices are SCALA, PYTHON, SQL, R.
29+
* `content` - (Required) The base64-encoded content. If the limit (10MB) is exceeded, an exception with error code MAX_NOTEBOOK_SIZE_EXCEEDED will be thrown. *This field is **deprecated** and will be renamed to `content_base64` in 0.3.*
30+
* `path` - (Required) The absolute path of the notebook or directory, beginning with "/", e.g. "/mynotebook".
31+
* `language` - (Required) The language. If format is set to SOURCE, this field is required; otherwise, it will be ignored. Possible choices are SCALA, PYTHON, SQL, R. *This field will become optional in the next release.*
3232
* `overwrite` - (Required) The flag that specifies whether to overwrite an existing object. It is false by default. *This field is **deprecated** and will be removed in 0.3.*
3333
* `mkdirs` - (Required) Create the given directory and necessary parent directories if they do not exist. If there exists an object (not a directory) at any prefix of the input path, this call returns an error RESOURCE_ALREADY_EXISTS. If this operation fails it may have succeeded in creating some of the necessary parent directories. *This field is **deprecated** and will be removed in 0.3.*
3434
* `format` - (Required) This specifies the format of the file to be imported. This resource currently only supports SOURCE. The value is case sensitive. SOURCE is suitable for .scala, .py, .r, .sql extension based files, HTML for .html files, JUPYTER for .ipynb files. Though the API supports DBC, HTML, and JUPYTER currently we do not support them as effectively identifying DIFF is currently not feasible. *This field is **deprecated** and will be removed in 0.3.*

storage/resource_dbfs_file.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ func ResourceDBFSFile() *schema.Resource {
3030

3131
Schema: map[string]*schema.Schema{
3232
"content": {
33+
Deprecated: "databricks_dbfs_file.content is deprecated and would be "+
34+
"renamed to `content_base64` in the next version. Please "+
35+
"rewrite your configuration to use `source` field.",
3336
Type: schema.TypeString,
3437
Optional: true,
3538
ForceNew: true,
@@ -41,6 +44,8 @@ func ResourceDBFSFile() *schema.Resource {
4144
ConflictsWith: []string{"content"},
4245
},
4346
"content_b64_md5": {
47+
Deprecated: "databricks_dbfs_file.content_b64_md5 is deprecated and would be "+
48+
"removed in the next version.",
4449
Type: schema.TypeString,
4550
Required: true,
4651
ForceNew: true,
@@ -51,16 +56,22 @@ func ResourceDBFSFile() *schema.Resource {
5156
ForceNew: true,
5257
},
5358
"overwrite": {
59+
Deprecated: "databricks_dbfs_file.overwrite is deprecated and would be "+
60+
"removed in the next version.",
5461
Type: schema.TypeBool,
5562
Optional: true,
5663
Default: false,
5764
},
5865
"mkdirs": {
66+
Deprecated: "databricks_dbfs_file.mkdirs is deprecated and would be "+
67+
"removed in the next version.",
5968
Type: schema.TypeBool,
6069
Optional: true,
6170
Default: true,
6271
},
6372
"validate_remote_file": {
73+
Deprecated: "databricks_dbfs_file.validate_remote_file is deprecated and would be "+
74+
"removed in the next version.",
6475
Type: schema.TypeBool,
6576
Optional: true,
6677
},

workspace/resource_notebook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ func ResourceNotebook() *schema.Resource {
205205
},
206206
Schema: map[string]*schema.Schema{
207207
"content": {
208+
Deprecated: "databricks_notebook.content is deprecated and is "+
209+
"going to be renamed to `content_base64` in version 0.3",
208210
Type: schema.TypeString,
209211
Required: true,
210212
ForceNew: true,

0 commit comments

Comments
 (0)