Skip to content

Commit 0c02582

Browse files
parthusun8alexott
andauthored
[Fix] update running workspace to include ManagedServicesCustomerManagedKeyID (#5034)
## Changes The change being made are to support the updation of managed_services_customer_managed_key_id as the API supports updating it even for running workspaces. ## Tests I updated the changed binary in dev_overrides and updated a running workspace to make the update. - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework - [ ] has entry in `NEXT_CHANGELOG.md` file --------- Co-authored-by: Alex Ott <[email protected]>
1 parent 19024cc commit 0c02582

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
### Bug Fixes
1010

11+
* Allow update `managed_services_customer_managed_key_id` in `databricks_mws_workspaces` ([#5034](https://github.com/databricks/terraform-provider-databricks/pull/5034))
12+
1113
### Documentation
1214

1315
* Clarify the use of `workspace-consume` entitlement and access to Databricks One ([#5043](https://github.com/databricks/terraform-provider-databricks/pull/5043))

mws/resource_mws_workspaces.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ func (a WorkspacesAPI) UpdateRunning(ws Workspace, timeout time.Duration) error
292292
if ws.StorageCustomerManagedKeyID != "" {
293293
request["storage_customer_managed_key_id"] = ws.StorageCustomerManagedKeyID
294294
}
295+
if ws.ManagedServicesCustomerManagedKeyID != "" {
296+
request["managed_services_customer_managed_key_id"] = ws.ManagedServicesCustomerManagedKeyID
297+
}
295298
if ws.CustomTags != nil {
296299
if !a.client.IsAws() {
297300
return fmt.Errorf("custom_tags are only allowed for AWS workspaces")

mws/resource_mws_workspaces_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -665,9 +665,10 @@ func TestResourceWorkspaceUpdate(t *testing.T) {
665665
Method: "PATCH",
666666
Resource: "/api/2.0/accounts/abc/workspaces/1234",
667667
ExpectedRequest: map[string]any{
668-
"credentials_id": "bcd",
669-
"network_id": "fgh",
670-
"storage_customer_managed_key_id": "def",
668+
"credentials_id": "bcd",
669+
"network_id": "fgh",
670+
"storage_customer_managed_key_id": "def",
671+
"managed_services_customer_managed_key_id": "def",
671672
},
672673
},
673674
{
@@ -1545,10 +1546,11 @@ func TestResourceWorkspaceUpdatePrivateAccessSettings(t *testing.T) {
15451546
Method: "PATCH",
15461547
Resource: "/api/2.0/accounts/abc/workspaces/1234",
15471548
ExpectedRequest: map[string]any{
1548-
"credentials_id": "bcd",
1549-
"network_id": "fgh",
1550-
"storage_customer_managed_key_id": "def",
1551-
"private_access_settings_id": "pas",
1549+
"credentials_id": "bcd",
1550+
"network_id": "fgh",
1551+
"storage_customer_managed_key_id": "def",
1552+
"managed_services_customer_managed_key_id": "def",
1553+
"private_access_settings_id": "pas",
15521554
},
15531555
},
15541556
{

0 commit comments

Comments
 (0)