Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vvalorous/76dd345aebc9aebb9f17ea076be3bf9b to your computer and use it in GitHub Desktop.
Save vvalorous/76dd345aebc9aebb9f17ea076be3bf9b 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.
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