Skip to content

Instantly share code, notes, and snippets.

@alexcasalboni
Created October 21, 2019 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexcasalboni/aed4bfed62db76db1237e1f5d1ead06c to your computer and use it in GitHub Desktop.
Save alexcasalboni/aed4bfed62db76db1237e1f5d1ead06c to your computer and use it in GitHub Desktop.
AWS Lambda function (HTTP) - Both Amazon API Gateway and AWS ALB
def handler(event, context):
input = extract_input_from_event('ALB', event)
output = my_business_logic(input)
return format_output_for('ALB', output)
def extract_input_from_event(alb_or_apigw, event):
# extract data from input event
def format_output_for(alb_or_apigw, output):
# return a json object
def my_business_logic(data):
# implement business logic here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment