-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_databricks_workspace
: Add support for CMK for disk encryption, multiple other updates
#19992
azurerm_databricks_workspace
: Add support for CMK for disk encryption, multiple other updates
#19992
Conversation
azurerm_databricks_workspace
: Add support for CMK for disk encryption, multiple other updates
@alexott here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR @favoretti, I left a few suggestions in-line but overall this is looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good for me.
Will DBFS encryption change come as a separate PR?
As discussed offline, made it updatable as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a test for updating the properties that are no longer ForceNew? Otherwise this should be good to go 👍
@favoretti new functionality is also supporting update of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
managed_disk_cmk_key_vault_key_id
is marked as ForceNew
so it recreates things on update
Also, I don't see that managedDiskIdentity.principalId
and managedDiskIdentity.tenantId
are exposed - we need them to set KV access policy
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a new test failure regarding the update of public network access
------- Stdout: -------
=== RUN TestAccDatabricksWorkspace_extendedUpdate
=== PAUSE TestAccDatabricksWorkspace_extendedUpdate
=== CONT TestAccDatabricksWorkspace_extendedUpdate
testcase.go:110: Step 3/4 error: Error running apply: exit status 1
Error: creating/updating Workspace (Subscription: "*******"
Resource Group Name: "acctestRG-databricks-230119204137101457"
Workspace Name: "acctestDBW-230119204137101457"): performing CreateOrUpdate: workspaces.WorkspacesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidPublicNetworkAccess" Message="Updating public network access is currently not allowed"
with azurerm_databricks_workspace.test,
on terraform_plugin_test.tf line 87, in resource "azurerm_databricks_workspace" "test":
87: resource "azurerm_databricks_workspace" "test" {
--- FAIL: TestAccDatabricksWorkspace_extendedUpdate (534.84s)
FAIL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
managed_disk_cmk_key_vault_key_id
is still marked with ForceNew: true
that causes workspace recreation. I made a custom build without it, and was able to perform upgrade. Documentation also needs to be updated to reflect this.
no_public_ip
is also marked as ForceNew: true
. We need to remove it as we support in-place update for a limited set of scenarios (only false
-> true
and only for VNet-injected workspaces). Documentation also needs to be updated
* `managed_services_cmk_key_vault_key_id` - (Optional) Customer managed encryption properties for the Databricks Workspace managed resources(e.g. Notebooks and Artifacts). Changing this forces a new resource to be created. | ||
* `managed_services_cmk_key_vault_key_id` - (Optional) Customer managed encryption properties for the Databricks Workspace managed resources(e.g. Notebooks and Artifacts). | ||
|
||
* `managed_disk_cmk_key_vault_key_id` - (Optional) Customer managed encryption properties for the Databricks Workspace managed disks. Changing this forces a new resource to be created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to remove Changing this forces a new resource to be created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so for the managed_disk_cmk...
I've removed both ForceNew
and docs. But as to no_public_ip
- I'd leave it on ForceNew
, since the use-case where it can be updated is somewhat all too narrow.
@stephybun What do you think?
@alexott Also, can you please let @stephybun know what needs to be done to the subscription by MSFT to allow for public_network_access updates? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ForceNew
on no_public_ip
unfortunately may block some of the old customers from upgrade... I don't see the problem of failing if the people are trying to update it, instead of forcing recreation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the no_public_ip
parameter to not force re-creation and added a note in the docs describing which use-case allows for an update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a ForceNewIfChange
to recreate the workspace if a user tries to update from true
to false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stephybun we need to check with dev team if it's really required. I expect that it should be possible to update it in-place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
d55e304
to
b07f130
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more comment about the update test, but otherwise this looks like it's good to go!
internal/services/databricks/databricks_workspace_resource_test.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @favoretti! I hope you don't mind I pushed a commit to change the value for no_public_ip
in the complete
test config to still test the update of this property for a valid scenario. The tests are passing so this LGTM 🎉
This functionality has been released in v3.41.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Introduce 2 new arguments:
managed_disk_cmk_key_vault_key_id
managed_disk_cmk_rotation_to_latest_version_enabled
Introduce 1 new attribute:
disk_encryption_set_id
public_network_access_enabled
,network_security_group_rules_required
,managed_services_cmk_key_vault_key_id
can be updated now.