# -*- coding: utf-8 -*- import json from lbdrabbit import LbdFuncConfig def handler(event, context): print(event) return {"status_code": "200", "body": json.dumps(event)} handler.__lbd_func_config__ = LbdFuncConfig() handler.__lbd_func_config__.s3_event_bucket_yes = True handler.__lbd_func_config__.s3_event_bucket_basename = "data-store" handler.__lbd_func_config__.s3_event_lbd_config_list = [ LbdFuncConfig.S3EventLambdaConfig( event=LbdFuncConfig.S3EventLambdaConfig.EventEnum.created_put, ) ]
# -*- coding: utf-8 -*- from lbdrabbit import LbdFuncConfig __lbd_func_config__ = LbdFuncConfig() __lbd_func_config__.apigw_method_int_type = LbdFuncConfig.ApiMethodIntType.rpc __lbd_func_config__.apigw_method_enable_cors_yes = True
# -*- coding: utf-8 -*- import json from lbdrabbit import LbdFuncConfig __lbd_func_config__ = LbdFuncConfig(lbd_func_timeout=30, ) users = { "uid_1": { "user_id": "uid_1", "name": "Alice" }, "uid_2": { "user_id": "uid_2", "name": "Bob" }, "uid_3": { "user_id": "uid_3", "name": "Cathy" }, } def get(event, context): return {"status_code": "200", "body": json.dumps(list(users.values()))} def post(event, context): print(event) return {"status_code": "200", "body": json.dumps({"post_data": event})}