https://github.com/mixmaxhq/aws-instance-metadata
https://github.com/mixmaxhq/aws-instance-metadata
corgi-tag
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mixmaxhq/aws-instance-metadata
- Owner: mixmaxhq
- License: mit
- Created: 2016-08-09T20:40:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-11-20T18:41:24.000Z (over 1 year ago)
- Last Synced: 2024-04-13T23:24:20.723Z (about 1 year ago)
- Topics: corgi-tag
- Language: JavaScript
- Homepage: https://www.mixmax.com/careers
- Size: 226 KB
- Stars: 3
- Watchers: 26
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## 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
```sh
npm install aws-instance-metadata
```or
```sh
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:```js
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
```