Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation for servicediscovery etc. #33371

Merged
merged 12 commits into from
Sep 8, 2023
3 changes: 3 additions & 0 deletions .changelog/33371.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_service_discovery_instance: Fix validation error "expected to match regular expression"
```
2 changes: 1 addition & 1 deletion internal/service/athena/workgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func ResourceWorkGroup() *schema.Resource {
ForceNew: true,
ValidateFunc: validation.All(
validation.StringLenBetween(1, 128),
validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z._-]+$`), "must contain only alphanumeric characters, periods, underscores, and hyphens"),
validation.StringMatch(regexache.MustCompile(`^[0-9A-Za-z_.-]+$`), "must contain only alphanumeric characters, periods, underscores, and hyphens"),
),
},
"state": {
Expand Down
4 changes: 2 additions & 2 deletions internal/service/servicediscovery/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ func ResourceInstance() *schema.Resource {
Elem: &schema.Schema{Type: schema.TypeString},
ValidateDiagFunc: validation.AllDiag(
validation.MapKeyLenBetween(1, 255),
validation.MapKeyMatch(regexache.MustCompile(`^[0-9A-Za-z!~-]+$`), ""),
validation.MapKeyMatch(regexache.MustCompile(`^[0-9A-Za-z!-~]+$`), ""),
validation.MapValueLenBetween(0, 1024),
validation.MapValueMatch(regexache.MustCompile(`^([0-9A-Za-z!~-][0-9A-Za-z \t!~-]*){0,1}[0-9A-Za-z!~-]{0,1}$`), ""),
validation.MapValueMatch(regexache.MustCompile(`^([0-9A-Za-z!-~][0-9A-Za-z \t!-~]*){0,1}[0-9A-Za-z!-~]{0,1}$`), ""),
),
},
"instance_id": {
Expand Down
Loading