def lambda_handler()

in code/extension_detector/extension_detector.py [0:0]


def lambda_handler(event, context):
    callerId = context.invoked_function_arn
    print(callerId)
    try:
        
        print("event: {}".format(event))

        if("Records" in event and event["Records"]):
            for record in event["Records"]:
                try:
                    print("Processing record: {}".format(record))

                    if("eventName" in record and record["eventName"] == "INSERT"):
                        if("dynamodb" in record and record["dynamodb"] and "NewImage" in record["dynamodb"]):
                            processRecord(record, syncBucketName, asyncBucketName, callerId)

                except Exception as e:
                    print("Failed to process record. Exception: {}".format(e))

    except Exception as e:
        print("Failed to process records. Exception: {}".format(e))