Skip to content

Commit

Permalink
Merge pull request #359 from toricls/add-new-regions
Browse files Browse the repository at this point in the history
Add new regions (Frankfurt, Tokyo, Singapore, Sydney)
  • Loading branch information
errordeveloper authored Dec 20, 2018
2 parents 894daf8 + 0b09c9a commit 7004856
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 33 deletions.
84 changes: 54 additions & 30 deletions pkg/ami/static_resolver_ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,75 @@ var StaticImages = map[string]map[string]map[int]map[string]string{
"1.10": {
"AmazonLinux2": {
ImageClassGPU: {
"eu-north-1": "ami-24b43a5a",
"eu-west-1": "ami-047637529a86c7237",
"us-east-1": "ami-03c499c67bc65c089",
"us-east-2": "ami-081210a2fd7f3c487",
"us-west-2": "ami-08754f7ac73185331",
"ap-northeast-1": "ami-02a0802829f472c55",
"ap-southeast-1": "ami-0092b6c977d1937f0",
"ap-southeast-2": "ami-0d0218a832355edf4",
"eu-central-1": "ami-03b492cd6806000ff",
"eu-north-1": "ami-24b43a5a",
"eu-west-1": "ami-047637529a86c7237",
"us-east-1": "ami-03c499c67bc65c089",
"us-east-2": "ami-081210a2fd7f3c487",
"us-west-2": "ami-08754f7ac73185331",
},
ImageClassGeneral: {
"eu-north-1": "ami-04b0f84e5a05e0b30",
"eu-west-1": "ami-03612357ac9da2c7d",
"us-east-1": "ami-027792c3cc6de7b5b",
"us-east-2": "ami-036130f4127a367f7",
"us-west-2": "ami-07af9511082779ae7",
"ap-northeast-1": "ami-06f4af3742fca5998",
"ap-southeast-1": "ami-0bc97856f0dd86d41",
"ap-southeast-2": "ami-05d25b3f16e685c2e",
"eu-central-1": "ami-06d069282a5fea248",
"eu-north-1": "ami-04b0f84e5a05e0b30",
"eu-west-1": "ami-03612357ac9da2c7d",
"us-east-1": "ami-027792c3cc6de7b5b",
"us-east-2": "ami-036130f4127a367f7",
"us-west-2": "ami-07af9511082779ae7",
},
},
"Ubuntu1804": {ImageClassGeneral: {
"eu-north-1": "",
"eu-west-1": "ami-07036622490f7e97b",
"us-east-1": "ami-06fd8200ac0eb656d",
"us-east-2": "ami-0866798422f5d546b",
"us-west-2": "ami-6322011b",
"ap-northeast-1": "ami-0d1700e2b1ee4a7d1",
"ap-southeast-1": "ami-02c9850ed9fb6e7dd",
"ap-southeast-2": "ami-0e862d31afc398f91",
"eu-central-1": "ami-0734d5f3fa10dcafc",
"eu-north-1": "",
"eu-west-1": "ami-07036622490f7e97b",
"us-east-1": "ami-06fd8200ac0eb656d",
"us-east-2": "ami-0866798422f5d546b",
"us-west-2": "ami-6322011b",
}},
},
"1.11": {
"AmazonLinux2": {
ImageClassGPU: {
"eu-north-1": "ami-69b03e17",
"eu-west-1": "ami-050db3f5f9dbd4439",
"us-east-1": "ami-08a0bb74d1c9a5e2f",
"us-east-2": "ami-04a758678ae5ebad5",
"us-west-2": "ami-014f4e495a19d3e4f",
"ap-northeast-1": "ami-080be783089a635dd",
"ap-southeast-1": "ami-05bbe4b57e4030910",
"ap-southeast-2": "ami-0da8916a67c116ace",
"eu-central-1": "ami-017912381e1ebb308",
"eu-north-1": "ami-69b03e17",
"eu-west-1": "ami-050db3f5f9dbd4439",
"us-east-1": "ami-08a0bb74d1c9a5e2f",
"us-east-2": "ami-04a758678ae5ebad5",
"us-west-2": "ami-014f4e495a19d3e4f",
},
ImageClassGeneral: {
"eu-north-1": "ami-082e6cf1c07e60241",
"eu-west-1": "ami-0a9006fb385703b54",
"us-east-1": "ami-0b4eb1d8782fc3aea",
"us-east-2": "ami-053cbe66e0033ebcf",
"us-west-2": "ami-094fa4044a2a3cf52",
"ap-northeast-1": "ami-063650732b3e8b38c",
"ap-southeast-1": "ami-0549ac6995b998478",
"ap-southeast-2": "ami-03297c04f71690a76",
"eu-central-1": "ami-0ce0ec06e682ee10e",
"eu-north-1": "ami-082e6cf1c07e60241",
"eu-west-1": "ami-0a9006fb385703b54",
"us-east-1": "ami-0b4eb1d8782fc3aea",
"us-east-2": "ami-053cbe66e0033ebcf",
"us-west-2": "ami-094fa4044a2a3cf52",
},
},
"Ubuntu1804": {ImageClassGeneral: {
"eu-north-1": "",
"eu-west-1": "",
"us-east-1": "",
"us-east-2": "",
"us-west-2": "",
"ap-northeast-1": "",
"ap-southeast-1": "",
"ap-southeast-2": "",
"eu-central-1": "",
"eu-north-1": "",
"eu-west-1": "",
"us-east-1": "",
"us-east-2": "",
"us-west-2": "",
}},
},
}
6 changes: 3 additions & 3 deletions pkg/ami/static_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var _ = Describe("AMI Static Resolution", func() {
ExpectError: false,
}),
Entry("with non-gpu instance and non-eks enabled region", ResolveCase{
Region: "ap-northeast-1",
Region: "ap-northeast-2",
Version: "1.10",
InstanceType: "t2.medium",
ImageFamily: "AmazonLinux2",
Expand Down Expand Up @@ -89,7 +89,7 @@ var _ = Describe("AMI Static Resolution", func() {
ExpectError: false,
}),
Entry("with gpu (p3) instance and non-eks enabled region", ResolveCase{
Region: "ap-northeast-1",
Region: "ap-northeast-2",
Version: "1.10",
InstanceType: "p3.2xlarge",
ImageFamily: "AmazonLinux2",
Expand Down Expand Up @@ -121,7 +121,7 @@ var _ = Describe("AMI Static Resolution", func() {
ExpectError: false,
}),
Entry("with non-gpu instance, non-eks enabled region and Ubuntu image", ResolveCase{
Region: "ap-northeast-1",
Region: "ap-northeast-2",
Version: "1.10",
InstanceType: "t2.medium",
ImageFamily: "Ubuntu1804",
Expand Down
16 changes: 16 additions & 0 deletions pkg/eks/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ const (
// RegionEUNorth1 represents the EU North Region Stockholm
RegionEUNorth1 = "eu-north-1"

// RegionEUCentral1 represents the EU Central Region Frankfurt
RegionEUCentral1 = "eu-central-1"

// RegionAPNorthEast1 represents the Asia-Pacific North East Region Tokyo
RegionAPNorthEast1 = "ap-northeast-1"

// RegionAPSouthEast1 represents the Asia-Pacific South East Region Singapore
RegionAPSouthEast1 = "ap-southeast-1"

// RegionAPSouthEast2 represents the Asia-Pacific South East Region Sydney
RegionAPSouthEast2 = "ap-southeast-2"

// DefaultRegion defines the default region, where to deploy the EKS cluster
DefaultRegion = RegionUSWest2

Expand All @@ -50,6 +62,10 @@ func SupportedRegions() []string {
RegionUSEast2,
RegionEUWest1,
RegionEUNorth1,
RegionEUCentral1,
RegionAPNorthEast1,
RegionAPSouthEast1,
RegionAPSouthEast2,
}
}

Expand Down

0 comments on commit 7004856

Please sign in to comment.