2013-05-22 01:28:41 -04:00
|
|
|
package amazonebs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2013-05-22 17:36:33 -04:00
|
|
|
type artifact struct {
|
2013-05-22 01:28:41 -04:00
|
|
|
// A map of regions to AMI IDs.
|
|
|
|
amis map[string]string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*artifact) BuilderId() string {
|
|
|
|
return BuilderId
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*artifact) Files() []string {
|
|
|
|
// We have no files
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*artifact) Id() string {
|
|
|
|
// TODO(mitchellh): Id
|
|
|
|
return "TODO"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *artifact) String() string {
|
|
|
|
amiStrings := make([]string, 0, len(a.amis))
|
|
|
|
for region, id := range a.amis {
|
|
|
|
single := fmt.Sprintf("%s: %s", region, id)
|
|
|
|
amiStrings = append(amiStrings, single)
|
|
|
|
}
|
|
|
|
|
|
|
|
return fmt.Sprintf("AMIs were created:\n\n%s", strings.Join(amiStrings, "\n"))
|
|
|
|
}
|