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

[ISSUE] Issue with `databricks_connection` resource (Salesforce connction)

Open shlomitubul opened this issue 7 months ago • 4 comments
trafficstars

Configuration

resource "databricks_connection" "salesforce-cloud" {

  name            = "salesforce"
  connection_type =  "SALESFORCE"
  comment         = "Salesforce cloud connection"
   options = {
    is_sandbox    = "false"
    client_id     = "some-client-id"
    client_secret = "some-client-secret"
    client_scope  = "full"
  }
}

Expected Behavior

The connection should be created without errors

Actual Behavior

cannot create connection: CONNECTION/CONNECTION_SALESFORCE must include the following option(s): refresh_token.

I'm not sure that requiring refresh token when creating a connection object via terraform/API makes sense, as far as I understand the dbx side can create this token since I also grant "refresh_token" scope in the salesforce connected app. as note the same error is thrown when I try to use databricks-cli, also, it works fine when creating it via UI .

is that possible that databricks API only implements Authorization Code flow and this is why it require this param? if so, maybe it possible to support JWT flow ? (didn't dig enough to see if that 100% match the use case + not familiar with SF much, so pardon if that's not relevant)

Steps to Reproduce

  1. terraform apply-->

Terraform and provider versions

Terraform v1.11.0
on darwin_arm64
+ provider registry.terraform.io/databricks/databricks v1.70.0
+ provider registry.terraform.io/hashicorp/google v6.27.0
+ provider registry.terraform.io/hashicorp/vault v4.7.0

Is it a regression?

nope, at least for me it didn't work before ( :

Debug Output

Important Factoids

Would you like to implement a fix?

i would but i suspect that its an dbx API thing

shlomitubul avatar Apr 06 '25 06:04 shlomitubul

@alexott, do you mind checking this? It will be much appreciated

shlomitubul avatar May 12 '25 08:05 shlomitubul

It's on the API side, not in Terraform. Unfortunately options for connections API isn't well documented

alexott avatar May 19 '25 14:05 alexott

It's on the API side, not in Terraform. Unfortunately options for connections API isn't well documented

Is there any plan to add proper support for this?

shlomitubul avatar Jun 03 '25 08:06 shlomitubul

it's a question to lakehouse federation team, not to Terraform developers.

alexott avatar Jun 03 '25 10:06 alexott