const sendAWSResponse = require('aws-cfn-custom-resource-response');
module.exports.handler = (event, context, callback) => {
if (!event) {
return callback('No event received');
}
const { RequestType } = event;
const sendResponse = sendAWSResponse(event);
if (RequestType === 'Delete') {
return sendResponse({
Status: 'SUCCESS'
}, callback);
}
if (RequestType === 'Create' || RequestType === 'Update') {
// do something
const success = true;
if (success) {
return sendResponse({
Status: 'SUCCESS'
}, callback);
}
return sendResponse({
Status: 'FAILED',
Reason: 'Reason for failure diplayed in cloudformation console'
}, callback);
}
return sendResponse({
Status: 'FAILED',
Reason: `Unsupported request type ${RequestType}`
}, callback);
};
forked from adriaan-pelzer/aws-cfn-custom-resource-response
-
Notifications
You must be signed in to change notification settings - Fork 0
clauseHQ/aws-cfn-custom-resource-response
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
AWS Cloudformation Custom Resource Response
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- JavaScript 100.0%