Ver código fonte

Merge pull request #1087 from kubecost/kaelan-add-aws-regions

Add support for additional AWS pricing regions
Kaelan Patel 4 anos atrás
pai
commit
0cb27b37d3
1 arquivos alterados com 31 adições e 22 exclusões
  1. 31 22
      pkg/cloud/awsprovider.go

+ 31 - 22
pkg/cloud/awsprovider.go

@@ -105,6 +105,7 @@ var awsRegions = []string{
 	"ap-southeast-1",
 	"ap-southeast-2",
 	"ap-northeast-1",
+	"ap-southeast-3",
 	"ca-central-1",
 	"cn-north-1",
 	"cn-northwest-1",
@@ -113,8 +114,10 @@ var awsRegions = []string{
 	"eu-west-2",
 	"eu-west-3",
 	"eu-north-1",
+	"eu-south-1",
 	"me-south-1",
 	"sa-east-1",
+	"af-south-1",
 	"us-gov-east-1",
 	"us-gov-west-1",
 }
@@ -303,28 +306,31 @@ var volTypes = map[string]string{
 // locationToRegion maps AWS region names (As they come from Billing)
 // to actual region identifiers
 var locationToRegion = map[string]string{
-	"US East (Ohio)":             "us-east-2",
-	"US East (N. Virginia)":      "us-east-1",
-	"US West (N. California)":    "us-west-1",
-	"US West (Oregon)":           "us-west-2",
-	"Asia Pacific (Hong Kong)":   "ap-east-1",
-	"Asia Pacific (Mumbai)":      "ap-south-1",
-	"Asia Pacific (Osaka-Local)": "ap-northeast-3",
-	"Asia Pacific (Seoul)":       "ap-northeast-2",
-	"Asia Pacific (Singapore)":   "ap-southeast-1",
-	"Asia Pacific (Sydney)":      "ap-southeast-2",
-	"Asia Pacific (Tokyo)":       "ap-northeast-1",
-	"Canada (Central)":           "ca-central-1",
-	"China (Beijing)":            "cn-north-1",
-	"China (Ningxia)":            "cn-northwest-1",
-	"EU (Frankfurt)":             "eu-central-1",
-	"EU (Ireland)":               "eu-west-1",
-	"EU (London)":                "eu-west-2",
-	"EU (Paris)":                 "eu-west-3",
-	"EU (Stockholm)":             "eu-north-1",
-	"South America (Sao Paulo)":  "sa-east-1",
-	"AWS GovCloud (US-East)":     "us-gov-east-1",
-	"AWS GovCloud (US-West)":     "us-gov-west-1",
+	"US East (Ohio)":            "us-east-2",
+	"US East (N. Virginia)":     "us-east-1",
+	"US West (N. California)":   "us-west-1",
+	"US West (Oregon)":          "us-west-2",
+	"Asia Pacific (Hong Kong)":  "ap-east-1",
+	"Asia Pacific (Mumbai)":     "ap-south-1",
+	"Asia Pacific (Osaka)":      "ap-northeast-3",
+	"Asia Pacific (Seoul)":      "ap-northeast-2",
+	"Asia Pacific (Singapore)":  "ap-southeast-1",
+	"Asia Pacific (Sydney)":     "ap-southeast-2",
+	"Asia Pacific (Tokyo)":      "ap-northeast-1",
+	"Asia Pacific (Jakarta)":    "ap-southeast-3",
+	"Canada (Central)":          "ca-central-1",
+	"China (Beijing)":           "cn-north-1",
+	"China (Ningxia)":           "cn-northwest-1",
+	"EU (Frankfurt)":            "eu-central-1",
+	"EU (Ireland)":              "eu-west-1",
+	"EU (London)":               "eu-west-2",
+	"EU (Paris)":                "eu-west-3",
+	"EU (Stockholm)":            "eu-north-1",
+	"EU (Milan)":                "eu-south-1",
+	"South America (Sao Paulo)": "sa-east-1",
+	"Africa (Cape Town)":        "af-south-1",
+	"AWS GovCloud (US-East)":    "us-gov-east-1",
+	"AWS GovCloud (US-West)":    "us-gov-west-1",
 }
 
 var regionToBillingRegionCode = map[string]string{
@@ -339,6 +345,7 @@ var regionToBillingRegionCode = map[string]string{
 	"ap-southeast-1": "APS1",
 	"ap-southeast-2": "APS2",
 	"ap-northeast-1": "APN1",
+	"ap-southeast-3": "APS4",
 	"ca-central-1":   "CAN1",
 	"cn-north-1":     "",
 	"cn-northwest-1": "",
@@ -347,7 +354,9 @@ var regionToBillingRegionCode = map[string]string{
 	"eu-west-2":      "EUW2",
 	"eu-west-3":      "EUW3",
 	"eu-north-1":     "EUN1",
+	"eu-south-1":     "EUS1",
 	"sa-east-1":      "SAE1",
+	"af-south-1":     "AFS1",
 	"us-gov-east-1":  "UGE1",
 	"us-gov-west-1":  "UGW1",
 }