AWS Lambda handler for managing CircleCI AWS credentials
$ npm install --save cloudformation-circleci-npm-lambda
var CircleHandler = require('cloudformation-circleci-npm-lambda')
const credentialsHandler = CircleHandler(function getToken () {
return Promise.resolve('my-npm-token')
})
exports.handler = function handler (event, context, callback) {
npmHandler(event, context)
.then(() => callback(null))
.catch((err) => callback(err))
}
The returned handler receives event data from CloudFormation and installs an NPM_TOKEN
environment variable on CircleCI. You are responsible for calling the handler's callback and triggering the completion of the Lambda execution. This allows you to chain other handlers into the same run.
MIT © Ben Drucker