Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ec2-info

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ec2-info

Extract ec2 metadata information from the local http interface on an ec2 instance

  • 0.0.1
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-76.92%
Maintainers
1
Weekly downloads
 
Created
Source

ec2-info

Extract ec2 metadata information from the local http interface on an ec2 instance

npm status

This module can be consumed programmatically or as a command line tool

Click here for complete reference about ec2 metadata information

Beware, though, when traversing the ec2 metadata information tree! There are some "traps" one is ought to know of in advance, if one is to save precious time... this is discussed here

example

npm i ec2-info

const ec2Info = require('ec2-info')

ec2Info((err, info) => {
    if (err) return console.error(err)
    // prints: Map { 'instance-id' => 'foofoofoo', 'public-ipv4' => '1.2.3.4' }
    console.log(info) 
})

// custom properties
ec2Info(['instance-id', 'instance-type'], (err, info) => {
    if (err) return console.error(err)
    // prints: Map { 'instance-id' => 'foofoofoo', 'instance-type' => 'm4-large' }
    console.log(info) 
})

api

ec2Info([properties,] callback)

Fetch the default set of properties or the one specified in properties and return them in the callback inside an ES6 Map object.

If used on anything other than an ec2 instance as determined by is-ec2-machine the module will still work without an error but all the property values will be not an ec2 machine.

command line tool

npm i -g ec2-info

ec2-info --help

fetch some values:

ec2-info fetch --help

ec2-info fetch meta-data/public-ipv4 meta-data/instance-id --format=json

list some known keys

ec2-info index

license

MIT © ironSource ltd

Keywords

FAQs

Package last updated on 13 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc