Skip to content

Rust micro-library providing read access to AWS instance metadata

License

Notifications You must be signed in to change notification settings

mfenniak/aws_instance_metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws_instance_metadata

This is a small Rust library to pull AWS instance metadata for the currently running AWS instance from the AWS EC2 metadata web service (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html).

It currently only supports basic identity metadata; region, availability zone, instance type, account id, instance id, AMI id (image_id), and private IP.

Documentation: https://docs.rs/aws_instance_metadata

Distributed under the terms of the MIT license.

Example

Cargo.toml:

[dependencies]
aws_instance_metadata = "0.1"

main.rs:

extern crate aws_instance_metadata;

fn main() {
    let metadata = aws_instance_metadata::get().unwrap();
    println!("instance_id: {:?}", metadata.instance_id);
    println!("region: {:?}", metadata.region());
    println!("ip: {:?}", metadata.private_ip());
}

About

Rust micro-library providing read access to AWS instance metadata

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages