#!/usr/bin/perl

use strict;
use warnings;
use open ':std', ':encoding(UTF-8)';

use JSON::XS;
use YAML::Syck;
use LWP::Simple;

$YAML::Syck::SortKeys = 1;

my $id   = get "http://169.254.169.254/latest/meta-data/instance-id";
my $info = `aws ec2 describe-instances --instance-ids $id`;
my $href = decode_json($info);
my $yaml = YAML::Syck::Dump($href);

print $yaml;

