aws-instance-metadata

2.1.3 • Public • Published

aws-instance-metadata

This module is used to retrieve a piece of metadata for a running AWS EC2 instance. It returns takes a callback in order to return the data.

Install

npm install aws-instance-metadata

or

npm install aws-instance-metadata --save

Usage

When using raven.js, it's common to add server level information for debugging purposes. We can use aws-instance-metadata to do just that. In order to tag all future error messages with the instance ID, we could do:

const raven = require('raven').Client(/* configuration omitted */);
const awsInstanceMetadata = require('aws-instance-metadata');

awsInstanceMetadata.fetch('instance-id').then((instanceId) => {
  raven.setTagsContext({
    instanceId: instanceId
  });
}, console.error);

Publishing a new version

GH_TOKEN=xxx npx semantic-release --no-ci

/aws-instance-metadata/

    Package Sidebar

    Install

    npm i aws-instance-metadata

    Weekly Downloads

    54

    Version

    2.1.3

    License

    MIT

    Unpacked Size

    10 kB

    Total Files

    16

    Last publish

    Collaborators

    • mikusd
    • mixmax-codeship
    • bradvogel
    • jessem3
    • ahmed-anas
    • guilhermemj
    • jsalvata
    • gabriel-mixmax
    • eduard.borges
    • mixmaxkristina
    • raphaelbs
    • aaavakian
    • adborroto
    • andra.lazariuc
    • mixmax_it
    • leonardo-mixmax
    • shrihari-mixmax
    • akashbhalla
    • laszlovaspal
    • enuma
    • hishank
    • tharindu-wj
    • stefano.dalpiaz
    • kamilgruszka
    • joneslloyd
    • jordins
    • aminao
    • dombi
    • ttacon