Created
July 19, 2018 19:37
-
-
Save unacceptable/36f4c62fc24e65b88f61bc3386e8b435 to your computer and use it in GitHub Desktop.
This is a lambda handler that I am saving for the next time that I choose to execute lambda from a CloudFormation script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lambda_handler(event, context): | |
try: | |
logger.info(json.dumps(event,indent=4)) | |
main(event, context) | |
responseStatus = 'SUCCESS' | |
responseData = {} | |
except Exception as msg: | |
logger.error(msg) | |
responseStatus = 'FAILED' | |
responseData = {'error':msg} | |
logger.info( | |
'Sending CloudFormation Response. ' + | |
' Status: ' + responseStatus + ', ' + | |
' Status JSON: ' + str(responseData) | |
) | |
cfnresponse.send( | |
event, | |
context, | |
responseStatus, | |
responseData | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment