forked from virtual-kubelet/virtual-kubelet
/
region.go
48 lines (39 loc) · 1.09 KB
/
region.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package fargate
import (
"strings"
)
// Regions is the set of AWS regions where a service is available.
// https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/
type Regions []string
var (
// FargateRegions are AWS regions where Fargate is available.
FargateRegions = Regions{
"ap-northeast-1", // Asia Pacific (Tokyo)
"ap-southeast-1", // Asia Pacific (Singapore)
"ap-southeast-2", // Asia Pacific (Sydney)
"eu-central-1", // EU (Frankfurt)
"eu-west-1", // EU (Ireland)
"us-east-1", // US East (N. Virginia)
"us-east-2", // US East (Ohio)
"us-west-2", // US West (Oregon)
}
)
// Include returns whether the region set includes the given region.
func (r Regions) Include(region string) bool {
region = strings.ToLower(region)
region = strings.Trim(region, " ")
for _, name := range r {
if name == region {
return true
}
}
return false
}
// Names returns an array of region names.
func (r Regions) Names() []string {
names := make([]string, 0, len(r))
for _, name := range r {
names = append(names, name)
}
return names
}