npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ec2meta

v1.3.2

Published

Easily retrieve meta-data, user-data, tags and other information about the current AWS EC2 instance

Downloads

14

Readme

ec2meta

Easily retrieve meta-data, user-data, tags and other information about the AWS EC2 instance where the command is executed.

The tool is designed to be used in shell scripts, to easily retrieve information about the current EC2 instance.

For example:

LOCAL_IP=`ec2meta meta local-ipv4`
echo $LOCAL_IP

The tool requires either the instance to have a valid IAM Role or the user executing it to have a valid ~/.aws/credentials file. In both cases, the credentials must be granted access to EC2 in readonly mode. Please see the documentation of the AWS Node.js SDK for more information.

Metadata

Retrieve any instance meta-data by path. The specified path is concatenated to http://169.254.169.254/latest/meta-data/.

Examples:

$ ec2meta meta instance-id
$ ec2meta meta iam/info
$ ec2meta meta network/

Tags

Retrieve any instance tag by name:

$ ec2meta tag Name

User data

Retrieve the instance user data. If a path is specified, the data is treated as a JSON and searched using path as a JSON pointer.

Examples:

$ ec2meta user 
$ ec2meta meta some/custom/property

Instance identity document

Retrieve data from the instance identify document returned by http://169.254.169.254/latest/dynamic/instance-identity/document. The data to be retrieved is specified as a JSON Pointer and it’s returned, by default, as a JSON string is the value is an object, or as a raw value in all other cased. The JSON output can be forced using the -j option.

Examples:

$ ec2meta identity
$ ec2meta identify region
$ ec2meta identify instanceId

Instance data

Retrieve data from the description of the instance returned by EC2.describeInstances. The data to be retrieved is specified as a JSON Pointer and it’s returned, by default, as a JSON string is the value is an object, or as a raw value in all other cased. The JSON output can be forced using the -j option.

Examples:

$ ec2meta instance
$ ec2meta instance Placement/AvailabilityZone
$ ec2meta instance NetworkInterfaces/0/Status