Skip to content

Commit 946b987

Browse files
tobioCopilot
andauthored
Validate space ids meet the API requirements (#1555)
* Validate space ids meet the API requirements * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b7ebf7a commit 946b987

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)