INNER CODE UNIT · Python

on_create

aws-powertools/powertools-lambda-python · layer_v3/layer/canary/app.py:67

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:
        raise ValueError("POWERTOOLS_LAYER_ARN is not set. Aborting...")
    if not powertools_version:
        raise ValueError("POWERTOOLS_VERSION is not set. Aborting...")
    if not stage:
        raise ValueError("LAYER_PIPELINE_STAGE is not set. Aborting...")
    if not event_bus_arn:
        raise ValueError("VERSION_TRACKING_EVENT_BUS_ARN is not set. Aborting...")
    logger.info("All envs configured, continue...")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…