No description, website, or topics provided.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
README.md
aws-data.gemspec

README.md

aws-data

A rubygem for fetching data from AWS's user and metadata endpoints from ec2.

API

data = AWSData::Metadata.new

=begin

The constructor reaches out to the network to enumerate all the endpoints.
It'll block for a bit and then throw exceptions if you're not on EC2, or better
still do random undefined things if someone's chosen  to make 169.254/24
routable on your network

=end

data.instance-id #=> i-xxxxxxx

data.methods #=>
# ...
# 'ami_id',
# 'ami_launch_index',
# 'ami_manifest_path',
# 'block_device_mapping',
# 'hostname',
# 'instance_action',
# 'instance_id',
# 'instance_type',
# 'kernel_id',
# 'local_hostname',
# 'local_ipv4',
# 'mac',
# 'metrics',
# 'network',
# 'placement',
# 'profile',
# 'public_hostname',
# 'public_ipv4',
# 'public_keys',
# 'reservation_id',
# ...

=begin

Note that some of these will return a new Transport object, eg network, which has finder methods for it's keys

=end

See: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html