   (:require [aws.sdk.ec2 :as ec2])
   (:import (java.util UUID))
   (:use 
+    [flatland.useful.utils :only (defm)]
     [minderbinder.time :only (parse-time-unit)]
     [slingshot.slingshot :only  [throw+ try+]]
     [aws.sdk.ec2 :only 

        (ec2 stop-instances  (instance-id uuid))
        (wait-for-status this "stopped" {:timeout [2 :minute]}))
  (status [this] 
          (-> (ec2 describe-instances (instance-id-filter (instance-id uuid)))
              first :instances first :state :name
              ))) 

(defmethod translate :aws [{:keys [aws machine]}] 
  [(aws :endpoint) (dissoc aws :endpoint) (UUID/randomUUID)])

  Vm
  (create [this] 
          (debug "creating" uuid)
          (swap! (ids) assoc uuid 
            (-> (ec2 run-instances conf) :instances first :id)) 
          (when (= (image-desc (conf :image-id) :root-device-type) "ebs")
             (wait-for-attach endpoint uuid {:timeout [10 :minute]}))
          this)
  (delete [this]
          (debug "deleting" uuid)
          (ec2 terminate-instances (instance-id uuid))
          (wait-for-status this "terminated" {:timeout [5 :minute]}) 
          (swap! (ids) dissoc uuid))
  (start [this]
         (debug "starting" (instance-id uuid))
         (ec2 start-instances (instance-id uuid))
         (wait-for-status this "running" {:timeout [5 :minute]}))
  (stop [this]
