代码拉取完成,页面将自动刷新
package amazonec2
import (
"errors"
)
var (
errInvalidRegion = errors.New("invalid region specified")
errNoVpcs = errors.New("No VPCs found in region")
errMachineFailure = errors.New("Machine failed to start")
errNoIP = errors.New("No IP Address associated with the instance")
errComplete = errors.New("Complete")
)
type region struct {
AmiId string
}
var regionDetails map[string]*region = map[string]*region{
"ap-northeast-1": {"ami-44f1e245"},
"ap-southeast-1": {"ami-f95875ab"},
"ap-southeast-2": {"ami-890b62b3"},
"cn-north-1": {"ami-fe7ae8c7"},
"eu-west-1": {"ami-823686f5"},
"eu-central-1": {"ami-ac1524b1"},
"sa-east-1": {"ami-c770c1da"},
"us-east-1": {"ami-4ae27e22"},
"us-west-1": {"ami-d1180894"},
"us-west-2": {"ami-898dd9b9"},
"us-gov-west-1": {"ami-cf5630ec"},
}
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 "", errInvalidRegion
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。