dvalbuena1 / visa_rescheduler_aws

US VISA (ais.usvisa-info.com) appointment re-scheduler - Colombian adaptation - AWS Lambda
24 stars 10 forks source link

Function invocation failing on serverless due to not finding resources in event #16

Closed kchaya1 closed 1 year ago

kchaya1 commented 1 year ago

I get the following error when I try to use serverless invoke --function main to run it

{ "errorMessage": "'resources'", "errorType": "KeyError", "requestId": "39a91904-4d5d-4ac8-853f-2a703e819462", "stackTrace": [ " File \"/var/task/handler.py\", line 17, in lambda_handler\n event_arn = event[\"resources\"][0]\n" ] }

IIUC, the python command python -c "import setup; setup.as_lambda_function()" doesn't run the lambda function, it just deploys it. The error seems to be at this part of the code:

https://github.com/dvalbuena1/visa_rescheduler_aws/blob/main/handler.py#L16

So it seems the event doesn't contain the resources key? Has anyone else encoutered this? I ran it with the "-l" option to show the logs, so it seems like it is able to log in for me and search the dates,