Skip to content

[ISSUE] Issue with databricks_app dependent resources #4866

@Frunkh

Description

@Frunkh

Configuration

terraform {
  required_providers {
    databricks = {
      source  = "databricks/databricks"
      version = ">=1.85.0"
    }
  }
} 
resource "databricks_database_instance" "this" {
  name     = "ldh-lakebase-${lower(var.environment)}"
  capacity = "CU_1"
}

resource "databricks_app" "this" {
  name        = "placeholder"
  description = "placeholder"

  resources = [{
    name = "placeholder-database"
    database = {
      database_name = databricks_database_instance.this.name
      instance_name = "placeholder_app"
      permission    = "CAN_CONNECT_AND_CREATE"
    }
  }]

  depends_on = [databricks_database_instance.this]
} 

Expected Behavior

The terraform documentation (https://registry.terraform.io/providers/databricks/databricks/1.85.0/docs/resources/app) shows the database resource as a valid resource. I expect the provided terraform code to be accepted as valid.

Actual Behavior

The terraform plan fails to execute due to the following error message:

│ Error: Invalid Attribute Combination
│ 
│   with module.create-lakehouse-app.databricks_app.this,
│   on create_lakehouse_app/main.tf line 6, in resource "databricks_app" "this":
│    6: resource "databricks_app" "this" {
│ 
│ No attribute specified when one (and only one) of
│ [resources[0].job.<.secret,resources[0].job.<.serving_endpoint,resources[0].job.<.sql_warehouse,resources[0].job.<.uc_securable]
│ is required

As you can see, database is not listed in the examples in the error message. It looks like the documentation of version 1.85.0 and the actual state are not in sync?

Steps to Reproduce

terraform plan

Terraform and provider versions

Terraform: 1.10.2
Databricks provider: 1.85.0

Is it a regression?

No.

Debug Output

Important Factoids

No

Would you like to implement a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions