Skip to content

Commit 3a185e0

Browse files
committed
Validate space ids meet the API requirements
1 parent dddb89d commit 3a185e0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

internal/kibana/space.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ func ResourceSpace() *schema.Resource {
2222
Computed: true,
2323
},
2424
"space_id": {
25-
Description: "The space ID that is part of the Kibana URL when inside the space.",
26-
Type: schema.TypeString,
27-
Required: true,
28-
ForceNew: true,
25+
Description: "The space ID that is part of the Kibana URL when inside the space.",
26+
Type: schema.TypeString,
27+
Required: true,
28+
ForceNew: true,
29+
ValidateFunc: validation.StringMatch(regexp.MustCompile("[a-z0-9_-]+"), "must only contain lowercase letters, numbers, hyphens, and underscores"),
2930
},
3031
"name": {
3132
Description: "The display name for the space.",

0 commit comments

Comments
 (0)