Terraform: Grant account-level group access to instance profile

dvmentalmadess
Valued Contributor

We have setup SCIM with Okta at the account-level and setup Unity Catalog and are in the process of migrating groups from workspace-local to account-level. I have an instance profile that was assigned to a workspace-local group. using `databricks_group_instance_profile`. I'm trying to grant the account-level group access to the instance profile (the profile grants access to resources other than S3) and both `databricks_group_instance_profile` and `databricks_group_role` return the following error:

cannot create group instance profile: invalidSyntax Groups attribute cannot be updated as group [name] can only be managed in account.

Or

cannot create group role: invalidSyntax Groups attribute cannot be updated as group [name] can only be managed in account.

If I set the provider to point to accounts.cloud.databricks.com then I get:

cannot create group role: invalidValue Invalid role value [arn]

Or

cannot create group instance profile: invalidValue Invalid role value [arn]

Finally, on a lark I tried to create the `databricks_instance_profile` using the accounts.cloud.databricks.com host and that didn't work either (as expected):

cannot create instance profile: HTTP method POST is not supported by this URL

Using `databricks_group_instance_profile` using the workspace host will actually set the permission successfully even though it throws an error. However, because of the error the resource is never added to Terraform state and `terraform apply` fails anyway so it wouldn't matter anyhow.

Granting permission to the group on the instance profile works fine manually if I use the workspace UI, but that is only a temporary fix since we manage our entire workspace in terraform. How am I supposed to get this to work?

Terraform: v1.4.2

Databricks provider(s): v1.13.0, v1.14.3