Comparing version
22
index.js
@@ -49,15 +49,27 @@ 'use strict'; | ||
let environmentId; | ||
let environment = { | ||
id: false, | ||
name: false, | ||
health: false, | ||
status: false | ||
}; | ||
data.Environments.forEach(e => { | ||
if (canonicalName === e.CNAME) environmentId = e.EnvironmentId | ||
if (canonicalName === e.CNAME) { | ||
environment = { | ||
id: e.environmentId, | ||
name: e.EnvironmentName, | ||
health: Health, | ||
status: Status | ||
}; | ||
}; | ||
}); | ||
if (!environmentId) { | ||
return reject(`No environments are associated with the following canonical name: ${canonicalName}`); | ||
if (!environment.id) { | ||
return reject(`No environment are associated with the following canonical name: ${canonicalName}`); | ||
} | ||
return resolve(environmentId); | ||
return resolve(environment); | ||
}); | ||
}); | ||
}; |
{ | ||
"name": "aws-ebc", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"description": "Get the id of environment on Elastic Beanstalk by their canonical name.", | ||
@@ -22,9 +22,5 @@ "license": "MIT", | ||
"eb", | ||
"elastic", | ||
"beanstalk", | ||
"elasticbeanstalk", | ||
"get", | ||
"environment", | ||
"id", | ||
"cname" | ||
"describe" | ||
], | ||
@@ -31,0 +27,0 @@ "devDependencies": { |
@@ -8,3 +8,3 @@ # aws-ebc [](https://travis-ci.org/ceasbz/aws-ebc) [](https://david-dm.org/ceasbz/aws-ebc) [](https://www.npmjs.org/package/aws-ebc) | ||
If you use Blue Green Deployment with Elastic Beanstalk, know that there is no fixed id for the environments. Through the Swap Url's you make the switch the canonical name of the environments. | ||
If you use ***Blue Green Deployment*** with [Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/), know that there is no fixed id for the environments. Through the Swap Url's you make the switch the canonical name of the environments. | ||
@@ -74,2 +74,2 @@ So you can assume that the only fixed reference is the canonical name of your environment. However, the SDK of AWS does not Provide an API where you find in this way. And this package is for it :) | ||
MIT © [Cauê Alves](./README.md) | ||
MIT © [Cauê Alves](./LICENSE) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7900
4.61%82
17.14%1
-50%1
Infinity%