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

[FEATURE] Change "owner" of clusters

Open andrewmetcalfbede opened this issue 2 years ago • 4 comments
trafficstars

Requesting the ability to change the owner of a cluster to workaround the below error:

Error: cannot update cluster: Only Cluster Owner is allowed to change the secrets.

This is possible via the API but not via the provider:

https://docs.databricks.com/api/azure/workspace/clusters/changeowner https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/cluster

Use-cases

Change the "Cluster owner" to an owning group to which multiple identities can belong thus not limiting the ability to update secrets to the identity that created the cluster.

Note: the "cluster owner" doesn't appear to actually be a thing in the UI or when querying the metadata of a cluster using the CLI command databricks clusters get. I see the creator_user_name key which I presume is what is being referred to as the "cluster owner" as the value of that is the service principal that created the cluster, which is different to the service principal I'm using.

Attempted Solutions

None

Proposal

resource "databricks_cluster" "example" {
  owner  = "some-principal-id"
}

References

Wasn't able to find any other open or closed issues.

andrewmetcalfbede avatar Aug 01 '23 17:08 andrewmetcalfbede

@databricks/eng-dev-ecosystem @databricks/field-dev-ecosystem this one looks simple, but not sure what is the right resource for this. databricks_cluster is already quite complex, so maybe we should use databricks_permissions?

nkvuong avatar Aug 09 '23 19:08 nkvuong

There is no separate IS_OWNER permission for clusters, so it should be handled specially in the databricks_permissions - it's doable, but just adding one additional path.

alexott avatar Sep 26 '23 18:09 alexott

hello @nkvuong @alexott , has this feature been implemented?

portoedu avatar Feb 15 '24 19:02 portoedu

@portoedu no, as I mentioned half year ago - there is no corresponding permission, and a separate API is hard to fit. Please raise this issue to a solution architect who works with your account.

alexott avatar Feb 15 '24 19:02 alexott