in source/helper/website_helper.py [0:0]
def lambda_handler(event, context):
"""
Handle Lambda event from AWS
"""
try:
LOGGER.info('REQUEST RECEIVED:\n {s}'.format(s=event))
LOGGER.info('REQUEST RECEIVED:\n {s}'.format(s=context))
if event['RequestType'] == 'Create':
LOGGER.info('CREATE!')
copy_source(event, context)
elif event['RequestType'] == 'Update':
LOGGER.info('UPDATE!')
copy_source(event, context)
elif event['RequestType'] == 'Delete':
LOGGER.info('DELETE!')
send_response(event, context, "SUCCESS",
{"Message": "Resource deletion successful!"})
else:
LOGGER.info('FAILED!')
send_response(event, context, "FAILED", {"Message": "Unexpected event received from CloudFormation"})
except Exception as e:
LOGGER.info('FAILED!')
send_response(event, context, "FAILED", {"Message": "Exception during processing: {e}".format(e=e)})