Skip to content

Commit d7227ae

Browse files
Merge pull request #478 from SumoLogic/SUMO-205874-remmove-connection-name-regex-validation
Sumo 205874 remmove connection name regex validation
2 parents 4634269 + dfa6ac3 commit d7227ae

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ FEATURES:
55

66
BUG FIXES:
77
* Added validations to fail if no trigger conditions defined in monitor resource (GH-463)
8+
* Fixed validation on connection name to match with UI/API (GH-478)
89

910
## 2.20.0 (December 15, 2022)
1011
FEATURES:

sumologic/resource_sumologic_connection.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import (
44
"encoding/json"
55
"fmt"
66
"log"
7-
"regexp"
87

98
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
109
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
1110
)
1211

1312
func resourceSumologicConnection() *schema.Resource {
14-
nameValidation := `^([a-zA-Z0-9 +%\-@.,_()]+)$`
1513
return &schema.Resource{
1614
Create: resourceSumologicConnectionCreate,
1715
Read: resourceSumologicConnectionRead,
@@ -34,7 +32,6 @@ func resourceSumologicConnection() *schema.Resource {
3432
Required: true,
3533
ValidateFunc: validation.All(
3634
validation.StringLenBetween(1, 128),
37-
validation.StringMatch(regexp.MustCompile(nameValidation), fmt.Sprintf("Must match regex %s", nameValidation)),
3835
),
3936
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
4037
newJSON, _ := normalizeJsonString(new)

sumologic/resource_sumologic_connection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
// Testing create functionality for Connection resources
1313
func TestAccConnection_create(t *testing.T) {
1414
connectionType := "WebhookConnection"
15-
name := acctest.RandomWithPrefix("tf-connection-test-name")
15+
name := acctest.RandomWithPrefix("tf-connection-test-name -+%@,. ()':")
1616
description := acctest.RandomWithPrefix("tf-connection-test-description")
1717
url := "https://example.com"
1818
defaultPayload := "{\"eventType\" : \"{{Name}}\"}"

0 commit comments

Comments
 (0)