Skip to content

Commit 6fef8d9

Browse files
authored
Prevent creation ofusers and admins groups (databricks#1091)
Fix databricks#1089
1 parent 3ad142f commit 6fef8d9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Version changelog
22

3+
## 0.4.9
4+
5+
* Prevent creation of `databricks_group` with `users` and `admins` reserved names ([#1089](https://github.com/databrickslabs/terraform-provider-databricks/issues/1089)).
6+
37
## 0.4.8
48

59
* Added support for `tf:suppress_diff` on primitive types ([#984](https://github.com/databrickslabs/terraform-provider-databricks/issues/984)).

scim/resource_group.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ import (
77

88
"github.com/databrickslabs/terraform-provider-databricks/common"
99
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
10+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1011
)
1112

1213
// ResourceGroup manages user groups
1314
func ResourceGroup() *schema.Resource {
1415
groupSchema := map[string]*schema.Schema{
1516
"display_name": {
16-
Type: schema.TypeString,
17+
Type: schema.TypeString,
18+
ValidateDiagFunc: validation.ToDiagFunc(
19+
validation.StringNotInSlice(
20+
[]string{"users", "admins"}, false)),
1721
Required: true,
1822
ForceNew: true,
1923
},

0 commit comments

Comments
 (0)