# -*- coding: utf-8 -*-
import boto.utils
meta = boto.utils.get_instance_metadata(version='latest', url=u'http://169.254.169.254', timeout=None, num_retries=5)
# 情報がDICTに成ってる。持ってるDICTのKey一覧
for key in meta.keys():
print key
# InstanceIDを取得
print meta.get(u'instance-id')