// GetAmiInfo returns the a list of aws images that matched the given ami filters.
GetAmiInfo returns the a list of aws images that matched the given ami filters.
// GetAmiInfo returns the a list of aws images that matched the given ami filters .
func GetAmiInfo(ci AwsClientInfo, filters []*ec2.Filter) ([]*ec2.Image, error) {
	if ok, err := IsAmiExist(ci.SVC, filters); !ok {
		if err != nil {
			return nil, err
		}
		return nil, fmt.Errorf("UnableToGetAmiInfo: AMI doesnot exist in Region %s with Filters %v ", *ci.Region, filters)
	}
	input := &ec2.DescribeImagesInput{
		Filters: filters,
	}
	result, err := ci.SVC.DescribeImages(input)
	if ok, err := IsError(err); ok {
		return nil, err
	}
	images := result.Images
	return images, nil
}
func GetAmiInfo ( ci AwsClientInfo , filters [ ] * ec2 . Filter ) ( [ ] * ec2 . Image , error ) { if ok , err := IsAmiExist ( ci . SVC , filters ) ; ! ok { if err != nil { return nil , err } return nil , fmt . Errorf ( " " , * ci . Region , filters ) } input := & ec2 . DescribeImagesInput { Filters : filters , } result , err := ci . SVC . DescribeImages ( input ) if ok , err := IsError ( err ) ; ok { return nil , err } images := result . Images return images , nil }
GetAmiInfo returns the a list of aws images that matched the given ami filters.
GetAmiInfo returns the a list of aws images that matched the given ami filters .