From 55d3faee557e5ff82eee93ae62e071a206f6926d Mon Sep 17 00:00:00 2001 From: Alex Ott Date: Tue, 24 Dec 2024 13:30:28 +0100 Subject: [PATCH] [Fix] Send only what is required in Update of `databricks_credential` This is a workaround for a problem in the API spec. Resolves #4335 --- catalog/resource_credential.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/catalog/resource_credential.go b/catalog/resource_credential.go index 0f5921c81c..8e6ae81027 100644 --- a/catalog/resource_credential.go +++ b/catalog/resource_credential.go @@ -139,6 +139,11 @@ func ResourceCredential() common.Resource { } updateCredRequest.Owner = "" + // Workaround until backend team fixes API issue + if updateCredRequest.AwsIamRole != nil { // Update API accepts only RoleArn, not the rest of attributes + updateCredRequest.AwsIamRole = &catalog.AwsIamRole{RoleArn: updateCredRequest.AwsIamRole.RoleArn} + } + // End of workaround _, err = w.Credentials.UpdateCredential(ctx, updateCredRequest) if err != nil { if d.HasChange("owner") {