title: How do i query the meta data of an instance within aws and provide a json formatted output
body: <p>I am after example code that will query the meta data of an instance within AWS and provide a JSON formatted output.</p>
  
  <p>It can be any language as i just want to see any example.</p>
  
  <p>The code must allow for particular data key to be retrieved individually.</p>
  
  <p>I've tried getting information from
  <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html</a></p>