Miserlou/Zappa

Invoke lambda_handler with event argument

manycoding opened this issue · 0 comments

Context

There's no way to call lambda_handler in the same manner as AWS Lambda test for non-wsgi apps.
Related to #2146 #983

Expected Behavior

I wanna get an output from the specified lambda_handler function with specified event argument.

zappa invoke dev {"address":"5760 Teredo St., Sechelt, BC, Canada, VON 3A"}

{
  "parsed_address": {
    "street_address": "5760, Teredo St.",
    "city": "Sechelt",
    "state": "BC",
    "postcode": "VON 3A0",
    "country": "Canada"
  }
}

Actual Behavior

Nothing. In fact I cannot get any output even for raw commands:
zappa invoke dev 'print("hey")' --raw

Executing a test event from Lambda UI works as expected.

Possible Fix

Allow to

Steps to Reproduce

  1. Create a lambda_handler function with event and context
  2. Specify it in zappa_settings
  3. Zappa invoke from cli

Your Environment

  • Zappa version used:
    0.52.0
  • Operating System and Python version:
    3.7, Mac OS, Pipenv
  • Your zappa_settings.json:
dev:
    lambda_handler: api.lambda_handler