Skip to content

Instantly share code, notes, and snippets.

@fbrnc
Created December 9, 2015 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbrnc/a042b8b8949596991e36 to your computer and use it in GitHub Desktop.
Save fbrnc/a042b8b8949596991e36 to your computer and use it in GitHub Desktop.
cfn-response
exports.SUCCESS = "SUCCESS";
exports.FAILED = "FAILED";
exports.send = function(event, context, responseStatus, responseData, physicalResourceId) {
var responseBody = JSON.stringify({
Status: responseStatus,
Reason: "See the details in CloudWatch Log Stream: " + context.logStreamName,
PhysicalResourceId: physicalResourceId || context.logStreamName,
StackId: event.StackId,
RequestId: event.RequestId,
LogicalResourceId: event.LogicalResourceId,
Data: responseData
});
console.log("Response body:\n", responseBody);
context.done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment