Skip to content

Commit 297202a

Browse files
committed
intypes.IsAWSRegion: Support 'eusc' Regions.
1 parent 5ff12cf commit 297202a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

internal/types/aws_region.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ import (
99

1010
// IsAWSRegion returns whether or not the specified string is a valid AWS Region.
1111
func IsAWSRegion(s string) bool { // nosemgrep:ci.aws-in-func-name
12-
return regexache.MustCompile(`^[a-z]{2}(-[a-z]+)+-\d{1,2}$`).MatchString(s)
12+
return regexache.MustCompile(`^[a-z]{2,4}(-[a-z]+)+-\d{1,2}$`).MatchString(s)
1313
}

internal/types/aws_region_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func TestIsAWSRegion(t *testing.T) { // nosemgrep:ci.aws-in-func-name
1818
{"", false},
1919
{"eu-isoe-west-1", true},
2020
{"mars", false},
21+
{"eusc-de-east-1", true},
2122
} {
2223
ok := IsAWSRegion(tc.id)
2324
if got, want := ok, tc.valid; got != want {

0 commit comments

Comments
 (0)