@everymundo/aws-instance-identity
Advanced tools
Comparing version
17
index.js
@@ -1,5 +0,5 @@ | ||
const { urlToEndpoint, promiseDataTo } = require('@everymundo/promise-data-to'); | ||
const { urlToEndpoint, promiseGet } = require('@everymundo/promise-data-to'); | ||
const IDENTITY_ENDPOINT = urlToEndpoint('http://169.254.169.254/latest/dynamic/instance-identity/document'); | ||
IDENTITY_ENDPOINT.method = 'GET'; | ||
// IDENTITY_ENDPOINT.method = 'GET'; | ||
IDENTITY_ENDPOINT.maxRetry = 1; | ||
@@ -12,6 +12,11 @@ | ||
const getIdentityDocument = () => | ||
promiseDataTo(IDENTITY_ENDPOINT) | ||
.then(({resTxt}) => JSON.parse(resTxt)); | ||
const parseResponseText = ({resTxt}) => JSON.parse(resTxt); | ||
module.exports = { getIdentityDocument, IDENTITY_ENDPOINT }; | ||
const getIdentityDocument = () => promiseGet(IDENTITY_ENDPOINT) | ||
.then(parseResponseText); | ||
module.exports = { | ||
parseResponseText, | ||
getIdentityDocument, | ||
IDENTITY_ENDPOINT, | ||
}; |
{ | ||
"name": "@everymundo/aws-instance-identity", | ||
"version": "0.1.1", | ||
"description": "Returns information about the AWS Instance that calls it", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"_from": "@everymundo/aws-instance-identity@^0.1.1", | ||
"_id": "@everymundo/aws-instance-identity@0.1.1", | ||
"_inBundle": false, | ||
"_integrity": "sha512-Pm/QhfJt9otp5rMFbbGRxhHbQj18XAlHcYqMMhnXdXKL0TMBMJnwJL4P1RFBO53cK7VU0VbvSjOrPksRGFyFCQ==", | ||
"_location": "/@everymundo/aws-instance-identity", | ||
"_phantomChildren": { | ||
"@everymundo/json-utils": "1.0.0", | ||
"@everymundo/simple-logr": "1.1.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/EveryMundo/aws-instance-identity.git" | ||
"_requested": { | ||
"type": "range", | ||
"registry": true, | ||
"raw": "@everymundo/aws-instance-identity@^0.1.1", | ||
"name": "@everymundo/aws-instance-identity", | ||
"escapedName": "@everymundo%2faws-instance-identity", | ||
"scope": "@everymundo", | ||
"rawSpec": "^0.1.1", | ||
"saveSpec": null, | ||
"fetchSpec": "^0.1.1" | ||
}, | ||
"keywords": [], | ||
"_requiredBy": [ | ||
"/@everymundo/em-eureka" | ||
], | ||
"_resolved": "http://registry.npmjs.org/@everymundo/aws-instance-identity/-/aws-instance-identity-0.1.1.tgz", | ||
"_shasum": "1b0fefffe37a3ef2e16a98686ffb639fd9791a5e", | ||
"_spec": "@everymundo/aws-instance-identity@^0.1.1", | ||
"_where": "/home/everymundo/EM/microservices/google-ita-worker/node_modules/@everymundo/em-eureka", | ||
"author": { | ||
@@ -18,11 +33,25 @@ "name": "Daniel Santana", | ||
}, | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/EveryMundo/aws-instance-identity/issues" | ||
}, | ||
"bundleDependencies": false, | ||
"dependencies": { | ||
"@everymundo/promise-data-to": "^1.2.1", | ||
"socks-proxy-agent": "^4.0.1" | ||
}, | ||
"deprecated": false, | ||
"description": "Returns information about the AWS Instance that calls it", | ||
"homepage": "https://github.com/EveryMundo/aws-instance-identity#readme", | ||
"dependencies": { | ||
"@everymundo/promise-data-to": "^0.3.0", | ||
"socks-proxy-agent": "^3.0.1" | ||
} | ||
"keywords": [], | ||
"license": "MIT", | ||
"main": "index.js", | ||
"name": "@everymundo/aws-instance-identity", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/EveryMundo/aws-instance-identity.git" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
}, | ||
"version": "0.2.0" | ||
} |
6181
5.26%16
33.33%4
-20%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated