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

Add missing AWS Regions for validation #111

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/endpoints/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (p partition) Partition() Partition {
}

// TODO: this should be generated from the AWS SDK source data
// Data from https://github.com/aws/aws-sdk-go/blob/main/models/endpoints/endpoints.json.
var partitions = []partition{
{
id: "aws",
Expand All @@ -58,9 +59,11 @@ var partitions = []partition{
"ap-east-1", // Asia Pacific (Hong Kong).
"ap-northeast-1", // Asia Pacific (Tokyo).
"ap-northeast-2", // Asia Pacific (Seoul).
"ap-northeast-3", // Asia Pacific (Osaka).
"ap-south-1", // Asia Pacific (Mumbai).
"ap-southeast-1", // Asia Pacific (Singapore).
"ap-southeast-2", // Asia Pacific (Sydney).
"ap-southeast-3", // Asia Pacific (Jakarta).
"ca-central-1", // Canada (Central).
"eu-central-1", // Europe (Frankfurt).
"eu-north-1", // Europe (Stockholm).
Expand Down Expand Up @@ -97,13 +100,14 @@ var partitions = []partition{
regionRegex: regexp.MustCompile(`^us\-iso\-\w+\-\d+$`),
regions: []string{
"us-iso-east-1", // US ISO East.
"us-iso-west-1", // US ISO WEST.
},
},
{
id: "aws-iso-b",
regionRegex: regexp.MustCompile(`^us\-isob\-\w+\-\d+$`),
regions: []string{
"us-isob-east-1", // US ISO East.
"us-isob-east-1", // US ISOB East (Ohio).
},
},
}
4 changes: 4 additions & 0 deletions validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ func TestValidateRegion(t *testing.T) {
Region: "us-east-1",
ExpectError: false,
},
{
Region: "ap-northeast-3",
ExpectError: false,
},
{
Region: "us-gov-west-1",
ExpectError: false,
Expand Down