Closed BenMcClainCarpe closed 3 years ago
FYI @ricardogaspar2
@BenMcClainCarpe @ricardogaspar2
issue will be fixed in v0.3.10 - i really wonder how current integration test suite didn't catch this.
If anyone is willing to fix that earlier - it's DiffSuppressFunc
on skipvalidation field in StructToSchema callback.
as a workaround until then -
lifecycle {
ignore_changes = [skip_validation]
}
And is it really Error: doesn't support update
? It should have prompted to replace the resource.
And is it really
Error: doesn't support update
? It should have prompted to replace the resource.
Yea what you see up there was just a copy and paste from the run. It's not a huge thing, but thanks for looking into it.
@BenMcClainCarpe you should not be adding skip_validation = true
in the first place :)
We have to for the same tagging reasons as @tylangesmith in #762
ah, okay, then it makes sense :)
@BenMcClainCarpe Did the workaround help?
Yes it did. It recreates the instance profile each time an apply is run. I'm no databricks expert here though. @ricardogaspar2 could say whether that's a problem for currently running clusters/whatnot, when he gets a chance. As far as Terraform is concerned though, it works fine.
New code:
resource "databricks_instance_profile" "instance_role" {
provider = databricks.created_workspace
depends_on = [
aws_iam_role_policy.s3_policy,
aws_iam_role_policy.instance_profile_permissions,
databricks_mws_workspaces.this
]
instance_profile_arn = aws_iam_instance_profile.instance_role.arn
skip_validation = true
lifecycle { # See the note about this resource in the README.md
ignore_changes = [skip_validation]
}
}
Output:
# databricks_group_instance_profile.all must be replaced
-/+ resource "databricks_group_instance_profile" "all" {
~ group_id = "676678810592129" -> (known after apply) # forces replacement
~ id = "676678810592129|arn:aws:iam::694017378957:instance-profile/sdlc-devops-us-west-2-20211012221409208600000001" -> (known after apply)
# (1 unchanged attribute hidden)
}
Could you check if 1.x is not having this issue, just out of curiosity.
Just in case, provider core team is only testing with TF version adopted by 50% of users and currently it's v1.0
Hey nfx, I see the same behavior on terraform 1.0.9.
Without the lifecycle
block, it fails because it can't update.
With it, it recreates the databricks_instance_profile each time.
Configuration
Expected Behavior
Apply Terraform for the first time, it creates the instance profile within the workspace. (This works great!) When running it again without any changes, it should show that this instance profile has no changes.
Actual Behavior
When running Terraform apply again without changes, it tries to modify the instance profile resource in the below way:
APPROVE
Steps to Reproduce
databricks_instance_profile
resource in your Terraform code.terraform apply
terraform apply
Terraform and provider versions
Terraform v0.14.5
Your version of Terraform is out of date! The latest version is 1.0.9. You can update by downloading from https://www.terraform.io/downloads.html
Debug Output
Important Factoids
This relates strongly to #857 and #762