Skip to content

Commit 4382e70

Browse files
committed
SUMO-181080 Adding validation for name field
1 parent 6d93f05 commit 4382e70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sumologic/resource_sumologic_monitors_library_monitor.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,9 @@ func resourceSumologicMonitorsLibraryMonitor() *schema.Resource {
329329
},
330330

331331
"name": {
332-
Type: schema.TypeString,
333-
Required: true,
332+
Type: schema.TypeString,
333+
Required: true,
334+
ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[^\ ].*[^\ ]$`), "Name must not contain leading or trailing spaces"),
334335
},
335336

336337
"post_request_map": {

0 commit comments

Comments
 (0)