File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
examples/adb-unity-catalog-basic-demo/modules/metastore-and-users Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -142,13 +142,20 @@ locals {
142
142
143
143
// All governed by AzureAD, create or remove users to/from databricks account
144
144
resource "databricks_user" "this" {
145
- provider = databricks. azure_account
146
- for_each = local. all_users
147
- user_name = lower (local. all_users [each . key ][" user_principal_name" ])
148
- display_name = local. all_users [each . key ][" display_name" ]
149
- active = local. all_users [each . key ][" account_enabled" ]
150
- external_id = each. key
151
- force = true
145
+ provider = databricks. azure_account
146
+ for_each = local. all_users
147
+ user_name = lower (local. all_users [each . key ][" user_principal_name" ])
148
+ display_name = local. all_users [each . key ][" display_name" ]
149
+ active = local. all_users [each . key ][" account_enabled" ]
150
+ external_id = each. key
151
+ force = true
152
+ disable_as_user_deletion = true # default behavior
153
+
154
+ // Review warning before deactivating or deleting users from databricks account
155
+ // https://learn.microsoft.com/en-us/azure/databricks/administration-guide/users-groups/scim/#add-users-and-groups-to-your-azure-databricks-account-using-azure-active-directory-azure-ad
156
+ lifecycle {
157
+ prevent_destroy = true
158
+ }
152
159
}
153
160
154
161
// Extract information about service prinicpals users
@@ -195,4 +202,4 @@ resource "databricks_user_role" "account_admin" {
195
202
user_id = databricks_user. this [each . key ]. id
196
203
role = " account_admin"
197
204
depends_on = [databricks_group . this , databricks_user . this , databricks_service_principal . sp ]
198
- }
205
+ }
You can’t perform that action at this time.
0 commit comments