terraform-provider-databricks icon indicating copy to clipboard operation
terraform-provider-databricks copied to clipboard

[ISSUE] Problems with the settings resources generation

Open alexott opened this issue 1 year ago • 0 comments

Right now, there are a few problems with the settings resources, such as databricks_default_namespace_setting:

  1. Because ETag is used as a resource ID, it's not possible to import the resource easily - we need to have predictable ID for each of the settings
  2. When ETag is changing on update, the resource ID is also updated, leading to warnings from the Terraform, like this:
2024-02-16T11:10:43.113+0100 [WARN]  Provider "provider[\"registry.terraform.io/databricks/databricks\"]" produced an unexpected new value for databricks_default_namespace_setting.this, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .etag: was cty.StringVal("ACi1L_0ASHABAAosCh0KCXdvcmtzcGFjZRIQNjY4ODgwODEzMDU2MjMxNxIJbmFtZXNwYWNlGAQBAAA="), but now cty.StringVal("ACi1L_0ASHABAAosCh0KCXdvcmtzcGFjZRIQNjY4ODgwODEzMDU2MjMxNxIJbmFtZXNwYWNlGAUBAAA=")
      - .id: was cty.StringVal("ACi1L_0ASHABAAosCh0KCXdvcmtzcGFjZRIQNjY4ODgwODEzMDU2MjMxNxIJbmFtZXNwYWNlGAQBAAA="), but now cty.StringVal("ACi1L_0ASHABAAosCh0KCXdvcmtzcGFjZRIQNjY4ODgwODEzMDU2MjMxNxIJbmFtZXNwYWNlGAUBAAA=")

Proposal:

  • Generate predictable resource ID, like, setting_<name> or settings|name, or just a constant, like we do for some resources, like databricks_sql_global_config

alexott avatar Feb 16 '24 10:02 alexott