diff --git a/builtin/providers/aws/resources.go b/builtin/providers/aws/resources.go index bbc83c8ca..6aecab05c 100644 --- a/builtin/providers/aws/resources.go +++ b/builtin/providers/aws/resources.go @@ -38,11 +38,11 @@ func resource_aws_instance_create( // properly. rs := s.MergeDiff(d) + // Create the instance runOpts := &ec2.RunInstances{ ImageId: rs.Attributes["ami"], InstanceType: rs.Attributes["instance_type"], } - log.Printf("[DEBUG] Run configuration: %#v", runOpts) runResp, err := ec2conn.RunInstances(runOpts) if err != nil { @@ -52,8 +52,7 @@ func resource_aws_instance_create( instance := &runResp.Instances[0] log.Printf("[INFO] Instance ID: %s", instance.InstanceId) - // Store the resource state now so that we can return it in the case - // of any errors. + // Store the resulting ID so we can look this up later rs.ID = instance.InstanceId // Wait for the instance to become running so we can get some attributes diff --git a/main.go b/main.go index dabc2e084..31c0d5aed 100644 --- a/main.go +++ b/main.go @@ -100,9 +100,10 @@ func wrappedMain() int { } cli := &cli.CLI{ - Args: args, - Commands: Commands, - HelpFunc: cli.BasicHelpFunc("terraform"), + Args: args, + Commands: Commands, + HelpFunc: cli.BasicHelpFunc("terraform"), + HelpWriter: os.Stdout, } exitCode, err := cli.Run() @@ -131,7 +132,12 @@ func copyOutput(r io.Reader) { if err != nil { panic(err) } + defaultR, err := pr.Prefix("") + if err != nil { + panic(err) + } go io.Copy(os.Stderr, stderrR) go io.Copy(os.Stdout, stdoutR) + go io.Copy(os.Stdout, defaultR) }