Coder Social home page Coder Social logo

[ISSUE] `databricks_permissions` shows permanent drift if the owner is not the same as the TF identifier about terraform-provider-databricks HOT 4 CLOSED

nkvuong avatar nkvuong commented on August 12, 2024 6
[ISSUE] `databricks_permissions` shows permanent drift if the owner is not the same as the TF identifier

from terraform-provider-databricks.

Comments (4)

alexott avatar alexott commented on August 12, 2024 1

no, it's not related to #2543 - warehouses have their own permissions

from terraform-provider-databricks.

NiklasA avatar NiklasA commented on August 12, 2024

I am encountering an simliar issue, where terraform apply shows changes every time it is run, even though no actual code/config modifications are being made.

Code:

variable "data_products" {
  description = "List of all data products with their respective attributes."
  type = list(object({
    id                = string
    repo_url          = string
    group_name_prefix = string
  }))
}

resource "databricks_permissions" "data_products_general_shared_autoscaling" {
  for_each = {
    for product in var.data_products : product.id => product
  }

  cluster_id = databricks_cluster.general_shared_autoscaling.id

  access_control {
    group_name       = "${each.value.group_name_prefix}_MANAGE"
    permission_level = "CAN_RESTART"
  }

  access_control {
    group_name       = "${each.value.group_name_prefix}_EDIT"
    permission_level = "CAN_RESTART"
  }

  access_control {
    group_name       = "${each.value.group_name_prefix}_RUN"
    permission_level = "CAN_RESTART"
  }

  access_control {
    group_name       = "${each.value.group_name_prefix}_MANAGE"
    permission_level = "CAN_ATTACH_TO"
  }

  access_control {
    group_name       = "${each.value.group_name_prefix}_EDIT"
    permission_level = "CAN_ATTACH_TO"
  }

  access_control {
    group_name       = "${each.value.group_name_prefix}_RUN"
    permission_level = "CAN_ATTACH_TO"
  }
}

Terminal

Plan: 0 to add, 5 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.

from terraform-provider-databricks.

patrickwilliamconway avatar patrickwilliamconway commented on August 12, 2024

I'm also seeing this state drift occur. I am working on migrating basic-auth --> oauth-m2m. All existing resources are owned by the root admin user, and I'm trying to now manage via a Service Principal.

from terraform-provider-databricks.

patrickwilliamconway avatar patrickwilliamconway commented on August 12, 2024

hey @nkvuong, do you have any insight into fixing this? I tried going back a few versions but still was having this issue. The trouble is that I have existing resources that I can't easily destroy/recreate so I can't go back that far. I'm currently I'm just using a lifecycle to ignore the diffs. Not ideal, but 🤷

resource "databricks_permissions" "endpoint_usage" {
  sql_endpoint_id = databricks_sql_endpoint.endpoint.id

  access_control {
    group_name       = var.company_group_name
    permission_level = "CAN_USE"
  }

  lifecycle {
    # https://github.com/databricks/terraform-provider-databricks/issues/3730
    ignore_changes = [
      access_control
    ]
  }
}

Also, any chance underlying issue is related to #2543? I'm using databricks_permissions to manage a sql_warehouse, not a cluster, but I assuming they're somewhat related.

from terraform-provider-databricks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.