module AwsWatcher::Chef

Public Class Methods

registered?(instance_id, config) click to toggle source
# File lib/aws-watcher.rb, line 6
def self.registered?(instance_id, config)
  chef = AwsCleaner::Chef.client(config)
  results = chef.search.query(:node, "ec2_instance_id:#{instance_id} OR chef_provisioning_reference_server_id:#{instance_id}")
  if results.rows.empty?
    false
  else
    true
  end
end