Add AWS instance id to normal output

The AWS instance id is only output when logging is occurring. If an
error happens it is useful to know the AWS instance id of the instance
spun up by packer in case further cleanup or forensics are needed.
This commit is contained in:
Mark Peek 2013-07-11 19:49:43 +00:00
parent d9c77c66f4
commit 7f5baf9ca4
1 changed files with 2 additions and 2 deletions

View File

@ -40,10 +40,10 @@ func (s *stepRunSourceInstance) Run(state map[string]interface{}) multistep.Step
s.instance = &runResp.Instances[0]
log.Printf("instance id: %s", s.instance.InstanceId)
ui.Say("Waiting for instance to become ready...")
ui.Say(fmt.Sprintf("Waiting for instance (%s) to become ready...", s.instance.InstanceId))
s.instance, err = waitForState(ec2conn, s.instance, []string{"pending"}, "running")
if err != nil {
err := fmt.Errorf("Error waiting for instance to become ready: %s", err)
err := fmt.Errorf("Error waiting for instance (%s) to become ready: %s", s.instance.InstanceId, err)
state["error"] = err
ui.Error(err.Error())
return multistep.ActionHalt