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

[ISSUE] databricks_git_credential issue with personal_access_token

Open Freia3 opened this issue 3 years ago • 4 comments

Hi,

I'm getting an error when creating the databricks_git_credential resource. I source the personal_access_token argument from the AZDO_PERSONAL_ACCESS_TOKEN env variable. This env variable is created from a build pipeline variable. I think the problem is that the AZDO_PERSONAL_ACCESS_TOKEN variable is different from when tf plan and tf apply are run (as a different build pipeline runs tf plan and tf apply).

Configuration

resource "databricks_git_credential" "ado" {
  git_username = "[email protected]"
  git_provider = "azureDevOpsServices"
  force        = true
}

Expected Behavior

Resource should have been created

Actual Behavior

I received the following error on terraform apply: │ Error: Provider produced inconsistent final plan │ │ When expanding the plan for databricks_git_credential.ado to include new │ values learned so far during apply, provider │ "registry.terraform.io/databrickslabs/databricks" produced an invalid new │ value for .personal_access_token: inconsistent values for sensitive │ attribute. │ │ This is a bug in the provider, which should be reported in the provider's │ own issue tracker.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. 'terraform plan'
  2. change the AZDO_PERSONAL_ACCESS_TOKEN env variable
  3. terraform apply

Terraform and provider versions

Terraform v1.0.4 databrickslabs/databricks: 0.6.0

Freia3 avatar Jun 09 '22 10:06 Freia3

@Freia3 please add more logs to the issue. Difficult to reproduce

nfx avatar Jun 09 '22 10:06 nfx

2022-06-09T13:38:49.707+0200 [WARN] Provider "registry.terraform.io/databrickslabs/databricks" produced an invalid plan for databricks_git_credential.ado, 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: - .personal_access_token: sensitive planned value for a non-computed attribute 2022-06-09T13:38:49.707+0200 [DEBUG] After incorporating new values learned so far during apply, databricks_git_credential.ado change has become NoOp 2022-06-09T13:38:49.707+0200 [ERROR] vertex "databricks_git_credential.ado" error: Provider produced inconsistent final plan

Freia3 avatar Jun 09 '22 11:06 Freia3

@Freia3 any interesting lines with terraform-provider-databricks-0.6.0 in them?

nfx avatar Jun 09 '22 11:06 nfx

@nfx no..

Freia3 avatar Jun 09 '22 11:06 Freia3

Following up - is this issue still relevant?

nfx avatar Aug 22 '22 09:08 nfx