Skip to content

Instantly share code, notes, and snippets.

@toshke
Created November 23, 2020 11:07
Show Gist options
  • Save toshke/a9eaf823766b25870bf14f15cd1d1b1e to your computer and use it in GitHub Desktop.
Save toshke/a9eaf823766b25870bf14f15cd1d1b1e to your computer and use it in GitHub Desktop.
Custom Resource error handling
import logging
import json
def handler(payload, context):
try:
response = CustomResourceResponse(payload)
# follow rule 2 - alway log the paylod
logging.info(json.dumps(payload))
## TODO: handle request from CFN
except Exception as e:
response.error(str(e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment