Created
June 21, 2019 13:47
-
-
Save lbjay/eff3a075a99bef9f0bed11739c72293b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const findInstance = (instances, name) => { | |
const found = instances.find((inst) => { | |
return inst.Tags.some((tag) => { | |
return tag.Key === `opsworks:layer:${name}`; | |
}); | |
}); | |
console.log(found); | |
return found; | |
}; | |
const resp = await EC2.describeInstances(instanceParams).promise(); | |
const admin = findInstance(resp.Reservations[0].Instances, 'admin'); | |
console.log(admin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment