Skip to content

Commit bece5ae

Browse files
authored
Removed custom client-side validation in databricks_service_principal (#1194)
Users will receive a bit more crypting message, but things will work in a more predictable way. Fix #1193
1 parent 4714508 commit bece5ae

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Version changelog
22

3+
## 0.5.4
4+
5+
* Completely removed custom client-side validation in `databricks_service_principal` ([#1193](https://github.com/databrickslabs/terraform-provider-databricks/issues/1193)).
6+
37
## 0.5.3
48

59
* Failures in [exporter](https://asciinema.org/a/Rv8ZFJQpfrfp6ggWddjtyXaOy) resource listing no longer halt the entire command run ([#1166](https://github.com/databrickslabs/terraform-provider-databricks/issues/1166)).

scim/resource_service_principal.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,6 @@ func ResourceServicePrincipal() *schema.Resource {
8181
}
8282
return common.Resource{
8383
Schema: servicePrincipalSchema,
84-
CustomizeDiff: func(ctx context.Context, d *schema.ResourceDiff, c interface{}) error {
85-
var sp entity
86-
common.DiffToStructPointer(d, servicePrincipalSchema, &sp)
87-
client := c.(*common.DatabricksClient)
88-
if client.IsAws() && sp.DisplayName == "" {
89-
return fmt.Errorf("display_name is required for service principals in Databricks on AWS")
90-
}
91-
if client.IsAws() && sp.ApplicationID != "" {
92-
return fmt.Errorf("application_id is not allowed for service principals in Databricks on AWS")
93-
}
94-
return nil
95-
},
9684
Create: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error {
9785
sp := spFromData(d)
9886
servicePrincipal, err := NewServicePrincipalsAPI(ctx, c).Create(sp)

scim/resource_service_principal_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,6 @@ func TestResourceServicePrincipalRead_NotFound(t *testing.T) {
102102
}.ApplyNoError(t)
103103
}
104104

105-
func TestResourceServicePrincipalRead_Invalid_AWS(t *testing.T) {
106-
qa.ResourceFixture{
107-
Resource: ResourceServicePrincipal(),
108-
New: true,
109-
Read: true,
110-
ID: "abc",
111-
}.ExpectError(t, "display_name is required for service principals in Databricks on AWS")
112-
}
113-
114105
func TestResourceServicePrincipalRead_Error(t *testing.T) {
115106
qa.ResourceFixture{
116107
Fixtures: []qa.HTTPFixture{

0 commit comments

Comments
 (0)