github.com/ttysteale/packer@v0.8.2-0.20150708160520-e5f8ea386ed8/builder/amazon/common/regions.go (about) 1 package common 2 3 // IsValidRegion returns true if the supplied region is a valid AWS 4 // region and false if it's not. 5 func ValidateRegion(region string) bool { 6 var regions = [11]string{"us-east-1", "us-west-2", "us-west-1", "eu-west-1", 7 "eu-central-1", "ap-southeast-1", "ap-southeast-2", "ap-northeast-1", 8 "sa-east-1", "cn-north-1", "us-gov-west-1"} 9 10 for _, valid := range regions { 11 if region == valid { 12 return true 13 } 14 } 15 return false 16 }