class Chef::Provider::AwsInstance

Public Instance Methods

create_aws_object(instance) click to toggle source
# File lib/chef/provider/aws_instance.rb, line 9
def create_aws_object(instance); end
destroy_aws_object(instance) click to toggle source
# File lib/chef/provider/aws_instance.rb, line 13
def destroy_aws_object(instance)
  message = "delete instance #{new_resource}"
  message += " in VPC #{instance.vpc.id}" unless instance.vpc.nil?
  message += " in #{region}"
  converge_by message do
    instance.terminate
  end
  converge_by "waited until instance #{new_resource} is :terminated" do
    # When purging, we must wait until the instance is fully terminated - thats the only way
    # to delete the network interface that I can see
    instance.wait_until_terminated do |w|
      # TODO: look at `wait_for_status` - delay and max_attempts should be configurable
      w.delay = 5
      w.max_attempts = 60
      w.before_wait do |attempts, _response|
        action_handler.report_progress "waited #{(attempts - 1) * 5}/#{60 * 5}s for #{instance.id} status to terminate..."
      end
    end
  end
end
update_aws_object(instance) click to toggle source
# File lib/chef/provider/aws_instance.rb, line 11
def update_aws_object(instance); end