1.0.0 • Published 8 years ago

lambda-cloudformation-response v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

lambda-cloudformation-response Build Status

Send a response from an AWS Lambda function in response to a CloudFormation custom resource request

Install

$ npm install --save lambda-cloudformation-response

Usage

In your Lambda

var respond = require('lambda-cloudformation-response')

exports.handler = function (event, context) {
  doWork()
    .then(function (result) {
      return respond(event, context, 'SUCCESS', result)  
    })
}

API

respond(event, context, status, [data]) -> promise

event
context

Required
Type: object

The event and context objects supplied by Lambda to a handler.

status

Required
Type: string
Values: 'SUCCESS', 'FAILURE'

A CloudFormation resource status string.

data

Type: object

Optional data to return to CloudFormation as resource results. These results can be retrieved elsewhere in the stack using the Fn::GetAtt function.

License

MIT © Ben Drucker