Skip to content

Commit e88fcd8

Browse files
Revert "remove the regex match in log search name"
This reverts commit b850a76.
1 parent b850a76 commit e88fcd8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sumologic/resource_sumologic_log_search.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
package sumologic
22

33
import (
4+
"fmt"
45
"log"
6+
"regexp"
57

68
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
79
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
810
)
911

1012
func resourceSumologicLogSearch() *schema.Resource {
1113

14+
nameRegex := `^[a-zA-Z0-9 +%\-@.,_()]+$`
15+
1216
return &schema.Resource{
1317
Create: resourceSumologicLogSearchCreate,
1418
Read: resourceSumologicLogSearchRead,
@@ -24,6 +28,7 @@ func resourceSumologicLogSearch() *schema.Resource {
2428
Required: true,
2529
ValidateFunc: validation.All(
2630
validation.StringLenBetween(1, 255),
31+
validation.StringMatch(regexp.MustCompile(nameRegex), fmt.Sprintf("Must match regex %s", nameRegex)),
2732
),
2833
},
2934
"description": {

0 commit comments

Comments
 (0)