func Terminate(ec2Ref *ec2.EC2, instance Instance) error { logger.Println("Terminating instance", instance.Id) _, err := ec2Ref.TerminateInstances([]string{instance.Id}) if err == nil { logger.Printf("Instance <%s> was destroyed!\n", instance.Id) } return err }
func terminate(c cmd, conn *ec2.EC2, args []string) { if len(args) == 0 { return } _, err := conn.TerminateInstances(args) if err != nil { fatalf("cannot terminate instances: %v", err) } }