1 Star 0 Fork 0

powerpaas/machine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
region.go 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
Jerome Loisel 提交于 2017-01-05 17:36 . Remove duplicate element
package amazonec2
import (
"errors"
)
type region struct {
AmiId string
}
// Ubuntu 16.04 LTS 20161221 hvm:ebs-ssd (amd64)
// See https://cloud-images.ubuntu.com/locator/ec2/
var regionDetails map[string]*region = map[string]*region{
"ap-northeast-1": {"ami-18afc47f"},
"ap-northeast-2": {"ami-93d600fd"},
"ap-southeast-1": {"ami-87b917e4"},
"ap-southeast-2": {"ami-e6b58e85"},
"ap-south-1": {"ami-dd3442b2"},
"ca-central-1": {"ami-7112a015"},
"cn-north-1": {"ami-31499d5c"},
"eu-central-1": {"ami-fe408091"},
"eu-west-1": {"ami-ca80a0b9"},
"eu-west-2": {"ami-ede2e889"},
"sa-east-1": {"ami-e075ed8c"},
"us-east-1": {"ami-9dcfdb8a"},
"us-east-2": {"ami-fcc19b99"},
"us-west-1": {"ami-b05203d0"},
"us-west-2": {"ami-b2d463d2"},
"us-gov-west-1": {"ami-19d56d78"},
"custom-endpoint": {""},
}
func awsRegionsList() []string {
var list []string
for k := range regionDetails {
list = append(list, k)
}
return list
}
func validateAwsRegion(region string) (string, error) {
for _, v := range awsRegionsList() {
if v == region {
return region, nil
}
}
return "", errors.New("Invalid region specified")
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/powerpaas/machine.git
git@gitee.com:powerpaas/machine.git
powerpaas
machine
machine
v0.12.0-rc2

搜索帮助

0d507c66 1850385 C8b1a773 1850385