// awsDescribeRegionsHandler returns the list of AWS regions.
awsDescribeRegionsHandler returns the list of AWS regions.
// awsDescribeRegionsHandler returns the list of AWS regions .
func awsDescribeRegionsHandler(w http.ResponseWriter, req *http.Request, _ *Context) error {
	awsSession, err := awsSessionFromRequest(req)
	if err != nil {
		return fromAWSErr(err)
	}
	ec2svc := ec2.New(awsSession)
	resp, err := ec2svc.DescribeRegions(&ec2.DescribeRegionsInput{})
	if err != nil {
		return fromAWSErr(err)
	}
	regions := make([]string, len(resp.Regions))
	for i, region := range resp.Regions {
		regions[i] = aws.StringValue(region.RegionName)
	}
	return writeJSONResponse(w, req, http.StatusOK, regions)
}
func awsDescribeRegionsHandler ( w http . ResponseWriter , req * http . Request , _ * Context ) error { awsSession , err := awsSessionFromRequest ( req ) if err != nil { return fromAWSErr ( err ) } ec2svc := ec2 . New ( awsSession ) resp , err := ec2svc . DescribeRegions ( & ec2 . DescribeRegionsInput { } ) if err != nil { return fromAWSErr ( err ) } regions := make ( [ ] string , len ( resp . Regions ) ) for i , region := range resp . Regions { regions [ i ] = aws . StringValue ( region . RegionName ) } return writeJSONResponse ( w , req , http . StatusOK , regions ) }
awsDescribeRegionsHandler returns the list of AWS regions.
awsDescribeRegionsHandler returns the list of AWS regions .