title: Getting EC2 instance name inside a Chef recipe
body: <p>How can I dynamically capture the ec2 instance name on which my Chef recipe is running?</p>
  
  <p>@coderanger I am using below code </p>
  
  <pre><code>Ohai.plugin(:EC2) do 
  provides "ec2" 
  depends "ec2" collect_data do 
  instance_id = ec2['instance_id'] 
  end 
  end 
  </code></pre>
  
  <p>How to print the instance id here ?</p>