Skip to content

Commit

Permalink
Update v4.0 RequiredWith schema attribute for managed_disk_cmk_rotati…
Browse files Browse the repository at this point in the history
…on_to_latest_version_enabled field...
  • Loading branch information
WodansSon committed Mar 21, 2024
1 parent 2da47ce commit f2366b9
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions internal/services/databricks/databricks_workspace_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,6 @@ func resourceDatabricksWorkspace() *pluginsdk.Resource {
},
},

"managed_disk_cmk_rotation_to_latest_version_enabled": {
Type: pluginsdk.TypeBool,
Optional: true,
RequiredWith: []string{"managed_disk_cmk_key_vault_key_id"},
},

"infrastructure_encryption_enabled": {
Type: pluginsdk.TypeBool,
ForceNew: true,
Expand Down Expand Up @@ -374,6 +368,13 @@ func resourceDatabricksWorkspace() *pluginsdk.Resource {
ValidateFunc: keyVaultValidate.KeyVaultChildID,
Deprecated: "`managed_disk_cmk_key_vault_key_id` will be removed in favour of the property `managed_disk_cmk_key_vault_key_resource_id` in version 4.0 of the AzureRM Provider.",
}

// Old Reference...
resource.Schema["managed_disk_cmk_rotation_to_latest_version_enabled"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Optional: true,
RequiredWith: []string{"managed_disk_cmk_key_vault_key_id"},
}
} else {
// NOTE: These fields maybe versioned or versionless...
resource.Schema["managed_services_cmk_key_vault_key_resource_id"] = &pluginsdk.Schema{
Expand All @@ -387,6 +388,13 @@ func resourceDatabricksWorkspace() *pluginsdk.Resource {
Optional: true,
ValidateFunc: validation.Any(commonids.ValidateKeyVaultKeyID, commonids.ValidateKeyVaultKeyVersionID),
}

// TODO: Make sure I updated this reference in the code below, see // Old Reference above...
resource.Schema["managed_disk_cmk_rotation_to_latest_version_enabled"] = &pluginsdk.Schema{
Type: pluginsdk.TypeBool,
Optional: true,
RequiredWith: []string{"managed_disk_cmk_key_vault_key_resource_id"},
}
}

return resource
Expand Down

0 comments on commit f2366b9

Please sign in to comment.