INNER CODE UNIT · Python
on_event
aws-powertools/powertools-lambda-python · layer_v3/layer/canary/app.py:58
def on_event(event, context):
request_type = event["RequestType"]
# we handle only create events, because we recreate the canary on each run
if request_type == "Create":
return on_create(event)
return "Nothing to be processed"
def on_create(event):
props = event["ResourceProperties"]
logger.info(f"create new resource with properties {props}")
handler(event)
def check_envs():
logger.info('Checking required envs ["POWERTOOLS_LAYER_ARN", "AWS_REGION", "STAGE"]')
if not layer_arn: