Created
November 23, 2020 11:07
-
-
Save toshke/a9eaf823766b25870bf14f15cd1d1b1e to your computer and use it in GitHub Desktop.
Custom Resource error handling
This file contains 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
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