databricks / terraform-provider-databricks

Databricks Terraform Provider
https://registry.terraform.io/providers/databricks/databricks/latest
Other
454 stars 392 forks source link

[ISSUE] Issue with `databricks_mws_credentials` resource #3016

Closed crankswagon closed 10 months ago

crankswagon commented 11 months ago

databricks_mws_credentials using account level provider configured with username + password auth failing in new version.

Error: cannot read mws credentials: invalid Databricks Account configuration

  with databricks_mws_credentials.this[0]
  on databricks-workspace.tf line 1, in resource "databricks_mws_credentials" "this":
    1: resource "databricks_mws_credential" "this {

Configuration

resource "databricks_mws_credentials" "this" {
  count           = var.environment == "redacted" ? 1 : 0
  provider        = databricks.account
  account_id      = local.databricks_account_id
  role_arn        = aws_iam_role.cross_account_role.arn
  credential_name = "${local.prefix}-creds"
  depends_on      = [aws_iam_role_policy.this]
}

provider "databricks" {
  alias    = "account"
  host     = "https://accounts.cloud.databricks.com"
  username = var.databricks_account_username
  password = var.databricks_account_password

}

Expected Behavior

Applies as per normal

Actual Behavior

Failed with invalid account error when using provider version 1.31.1

Steps to Reproduce

terraform plan

Terraform and provider versions

Works with 1.31.0 Fails with 1.31.1

Is it a regression?

Yes; last worked with 1.31.0

Debug Output

Possibly due to Go SDK refactor in new version

VPAI-Bixal commented 11 months ago

Commenting that we are seeing this issue as well. Works on 1.31.0 breaks on 1.31.1.

forma-wolf commented 11 months ago

This is affecting us too.

jpoletto-imo commented 11 months ago

This is effecting us too

burck1 commented 11 months ago

We are seeing this problem too. We rolled back to v1.31.0 for the time being.

mgyucht commented 10 months ago

This is addressed in https://github.com/databricks/terraform-provider-databricks/pull/3028. We plan to release the provider with this fix by EOD tomorrow. I will close this issue as there is no work to be done, and you can update to the release with this fix (will be 1.32.0) once it is available.

donatasm commented 10 months ago

Bumped to version 1.32.0, still getting exactly same error, as in version 1.31.1.

donatasm commented 10 months ago

Additionally, same error if optional account_id is removed from databricks_mws_credentials as mentioned in https://github.com/databricks/terraform-provider-databricks/pull/3028#pullrequestreview-1781557910.

BKY3-forpeople commented 10 months ago

We are still seeing the issue on 1.33.0

donatasm commented 10 months ago

I was able to update successfully to 1.33.0 after these changes:

VPAI-Bixal commented 10 months ago

I was able to update successfully to 1.33.0 after these changes:

* optional `account_id` is removed from all `databricks_mws_credentials` resources

* `account_id` is set in provider:
provider "databricks" {
  alias      = "mws"
  host       = "https://accounts.cloud.databricks.com"
  account_id = var.databricks_account_id
  // ...
}

So far this seems to be working for us, thanks!