Skip to content

Commit 0cbe322

Browse files
authored
Merge pull request #545 from SumoLogic/valdate_names_no_slashes
Ensure no "/" are present in names of monitors and slo objects
2 parents f278a16 + 40487c9 commit 0cbe322

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sumologic/resource_sumologic_monitors_library_monitor.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ func getMonitorBaseSchema() map[string]*schema.Schema {
3030
"name": {
3131
Type: schema.TypeString,
3232
Required: true,
33-
ValidateFunc: validation.StringMatch(regexp.MustCompile(`(?s)^[^\ ].*[^\ ]$`),
33+
ValidateFunc: validation.All(
34+
validation.StringDoesNotContainAny("/"),
35+
validation.StringMatch(regexp.MustCompile(`(?s)^[^\ ].*[^\ ]$`),
3436
"name must not contain leading or trailing spaces"),
37+
),
3538
},
3639

3740
"description": {

sumologic/resource_sumologic_slo.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ func resourceSumologicSLO() *schema.Resource {
166166
"name": {
167167
Type: schema.TypeString,
168168
Required: true,
169+
ValidateFunc: validation.StringDoesNotContainAny("/"),
169170
},
170171
"description": {
171172
Type: schema.TypeString,

0 commit comments

Comments
 (0)