survey-extraction/deployment/lambda/lambda_example/app.py
2025-07-17 13:33:20 +00:00

25 lines
No EOL
578 B
Python

"""
A quick example of lambda working a function in python
"""
def handler(event, context):
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)
}