builder/amazon/all: launched instances have a name [GH-642]

This commit is contained in:
Mitchell Hashimoto 2013-12-16 18:11:23 -08:00
parent 4c6800f5a3
commit b95ad0c232
2 changed files with 10 additions and 2 deletions

View File

@ -23,6 +23,8 @@ IMPROVEMENTS:
* core: Plugins communicate over a single TCP connection per plugin now,
instead of sometimes dozens. Performance around plugin communication
dramatically increased.
* builder/amazon/all: Launched EC2 instances now have a name of
"Packer Builder" so that they are easily recognizable. [GH-642]
* builder/amazon/all: Copying AMIs to multiple regions now happens
in parallel. [GH-495]
* builder/qemu: Floppy files are supported. [GH-686]

View File

@ -6,7 +6,6 @@ import (
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"io/ioutil"
"log"
)
type StepRunSourceInstance struct {
@ -91,7 +90,14 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
}
s.instance = &runResp.Instances[0]
log.Printf("instance id: %s", s.instance.InstanceId)
ui.Message(fmt.Sprintf("Instance ID: %s", s.instance.InstanceId))
_, err = ec2conn.CreateTags(
[]string{s.instance.InstanceId}, []ec2.Tag{{"Name", "Packer Builder"}})
if err != nil {
ui.Message(
fmt.Sprintf("Failed to tag a Name on the builder instance: %s", err))
}
ui.Say(fmt.Sprintf("Waiting for instance (%s) to become ready...", s.instance.InstanceId))
stateChange := StateChangeConf{