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

get-iam-creds

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-iam-creds - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

21

index.js

@@ -18,20 +18,9 @@ // TODO are we catching *all* the errors?

};
if (region) {
setRegion(region);
} else {
// brittle method to obtain region: shave last char off of AZ.
// example: 'us-west-2a' => 'us-west-2'.
// no other way exists unless we insert that via config mgmt.
imd.Get({Version: 'latest', Category: '/meta-data/placement/availability-zone' }, function(err, data) {
if (err) return cb(err);
var region = data.Body.substr(0, data.Body.length-1);
setRegion(region);
});
}
imd.Get({Version: 'latest', Category: '/dynamic/instance-identity/document'}, function(err, data) {
if (err) return cb(err);
creds.region = JSON.parse(data.Body).region;
cb(null, creds);
});
});
});
function setRegion(region) {
creds.region = region;
cb(null, creds);
}
};
{
"name": "get-iam-creds",
"version": "0.0.1",
"version": "0.0.2",
"description": "Tiny module to fetch IAM creds from IMD",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,7 +13,2 @@ get-iam-creds

Note: fetching the region is kinda brittle, so you may optionally pass
the region in as the second argument. If it's not passed in, then we'll
get the availability zone from IMD, shave off the last char, and use that.
If you only use one region, there's no need to do that API hit anyway.
## Example.

@@ -28,5 +23,1 @@ ### before:

getIamCreds(function(err, creds) { new CloudWatch(creds) });
#### or, in single region installs:
getIamCreds(function(err, creds) { new CloudWatch(creds) }, 'us-west-2');
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