From 060a3c58a358e76c1829f0aed644de2a42e23414 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Wed, 16 Jul 2025 15:01:35 +0000 Subject: [PATCH] update docker file --- deployment/lambda_example/app.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/deployment/lambda_example/app.py b/deployment/lambda_example/app.py index 05e2693..a520464 100644 --- a/deployment/lambda_example/app.py +++ b/deployment/lambda_example/app.py @@ -3,9 +3,24 @@ A quick example of lambda working a function in python """ def handler(event, context): - print("Hello from Python function. This shold be running from a dockerfile env and executed on a aws lambda!") - return { - 'statusCode': 200, - 'body': 'Hello World' - } + try: + s3_uri = event.get("file_location") + if not s3_uri: + return { + "statusCode": 400, + "body": "Missing 'file_location' in event" + } + print(f"s3 uri is {s3_uri}") + + return { + "statusCode": 200, + "body": f"s3 uri {s3_uri}" + } + + except Exception as e: + print(f"❌ Error: {e}") + return { + "statusCode": 500, + "body": str(e) + } \ No newline at end of file