1.0.9 • Published 1 year ago

knox-ec2-role v1.0.9

Weekly downloads
31
License
Apache-2.0
Repository
github
Last release
1 year ago

Build Status Downloads Downloads npm version dependencies dev dependencies License

knox-ec2-role

Create a Knox client using ec2 instance role metadata. Great for removing credentials from github and/or chef databags

See this guide which explains how to set up and use EC2 instance roles for your app.

Installation

npm install --save knox-ec2-role

Usage

var knoxec2 = require('knox-ec2-role')
var knox = require('knox')
knoxec2.authenticate(knox, {bucket: 'my-bucket'})
  .then(function(client){
    var req = client.put('/test/obj.json', {
      'Content-Type': 'application/json'
    })
    req.on('response', function(res){
      if (200 == res.statusCode) {
        console.log('saved to %s', req.url);
      }
    }
    req.end(JSON.stringify({foo: 'bar'}))
  })
  .catch(function(e){
    console.log('error fetching metadata:' + e)
  });

Changes

v1.0

  • authenticate takes knox object so caller can install any fork. e.g. knoxec2.authenticate(knox, {bucket: 'my-bucket'})

Credits

Tony Metzidis

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago