Skip to content

Commit 9e66946

Browse files
alexottnkvuong
andauthored
[Fix] Fix creation of databricks_storage_credential and databricks_credential resources on GCP with isolation mode (#4563)
## Changes <!-- Summary of your changes that are easy to understand --> Resolves #4562 ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [ ] using Go SDK - [ ] using TF Plugin Framework Co-authored-by: vuong-nguyen <[email protected]>
1 parent 796af80 commit 9e66946

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Bug Fixes
88

9+
* Fix creation of `databricks_storage_credential` and `databricks_credential` resources on GCP with isolation mode ([#4563](https://github.com/databricks/terraform-provider-databricks/pull/4563))
910
* Handle auto-enabled errors with `databricks_system_schema` [#4547](https://github.com/databricks/terraform-provider-databricks/pull/4547)
1011
* Skip Read after Create in `databricks_secret_acl` to avoid errors([#4548](https://github.com/databricks/terraform-provider-databricks/pull/4548)).
1112

catalog/resource_credential.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ func ResourceCredential() common.Resource {
8282
var update catalog.UpdateCredentialRequest
8383
common.DataToStructPointer(d, credentialSchema, &update)
8484
update.NameArg = d.Id()
85+
if update.DatabricksGcpServiceAccount != nil { // we can't update it at all
86+
update.DatabricksGcpServiceAccount = nil
87+
}
8588
_, err = w.Credentials.UpdateCredential(ctx, update)
8689
if err != nil {
8790
return err

catalog/resource_storage_credential.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func ResourceStorageCredential() common.Resource {
4848
common.DataToStructPointer(d, storageCredentialSchema, &create)
4949
common.DataToStructPointer(d, storageCredentialSchema, &update)
5050
update.Name = d.Get("name").(string)
51+
if update.DatabricksGcpServiceAccount != nil { // we can't update it at all
52+
update.DatabricksGcpServiceAccount = nil
53+
}
5154

5255
return c.AccountOrWorkspaceRequest(func(acc *databricks.AccountClient) error {
5356
storageCredential, err := acc.StorageCredentials.Create(ctx,

0 commit comments

Comments
 (0)