Skip to content

[ISSUE] Issue with databricks_external_location resource with file_event_queue updates #4872

@smokedlinq

Description

@smokedlinq

Configuration

resource "databricks_external_location" "this" {
  name               = "${var.context.catalog.name}-${var.context.schema_name}-${var.name}"
  url                = var.url
  credential_name    = var.context.default_credential_name
  comment            = "Managed by Terraform"
  enable_file_events = var.file_event_queue != null
  force_update       = true
  force_destroy      = true

  dynamic "file_event_queue" {
    for_each = toset(var.file_event_queue == null ? [] : [var.file_event_queue])
    content {
      provided_aqs {
        queue_url = file_event_queue.value
      }
    }
  }
}

Expected Behavior

The external location should be updated with file events enabled.

Actual Behavior

Error: cannot update external location: UpdateExternalLocation Missing required field: file_event_queue.provided_aqs.queue_url

Steps to Reproduce

  1. terraform apply

Terraform and provider versions

Terraform v1.12.2
on windows_amd64

  • provider registry.terraform.io/azure/azapi v2.5.0
  • provider registry.terraform.io/databricks/databricks v1.85.0
  • provider registry.terraform.io/hashicorp/azurerm v4.35.0

Is it a regression?

I'm not sure if this works on create only or if it's related to the ugly hack comment on the update.

Debug Output

Important Factoids

We just had file events enabled but are unable to enable file events on existing external locations.

Would you like to implement a fix?

I think this is related to this section of code but I'm not 100% sure.

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