Sha256: 7bacdd3ed272cd4b667773e5e2ea5f369c536fd2877ef2dd9c71d365608ce1db

Contents?: true

Size: 628 Bytes

Versions: 7

Compression:

Stored size: 628 Bytes

Contents

require "log4r"

module VagrantPlugins
  module AWS
    module Action
      # This terminates the running instance.
      class TerminateInstance
        def initialize(app, env)
          @app    = app
          @logger = Log4r::Logger.new("vagrant_aws::action::terminate_instance")
        end

        def call(env)
          server = env[:aws_compute].servers.get(env[:machine].id)

          # Destroy the server and remove the tracking ID
          env[:ui].info(I18n.t("vagrant_aws.terminating"))
          server.destroy
          env[:machine].id = nil

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-aws-0.2.2/lib/vagrant-aws/action/terminate_instance.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-aws-0.2.2/lib/vagrant-aws/action/terminate_instance.rb
tnargav-aws-0.2.2 lib/vagrant-aws/action/terminate_instance.rb
vagrant-aws-0.2.2 lib/vagrant-aws/action/terminate_instance.rb
vagrant-aws-0.2.1 lib/vagrant-aws/action/terminate_instance.rb
vagrant-aws-0.2.0 lib/vagrant-aws/action/terminate_instance.rb
vagrant-aws-0.1.3 lib/vagrant-aws/action/terminate_instance.rb