python-lambda
python-lambda copied to clipboard
`lambda deploy_s3` not working without changes to aws_lambda.py
When I tried to deploy through S3 using lambda deploy_s3
I encountered three issues.
- Setting
role: basic_s3_upload
inconfig.yaml
did not work, since it then tried to give that role to the lambda function.
I solved this issue by removing the role
definition in config.yaml
, and then everything worked.
- The filename on S3 was not properly passed along to the
update/create_function
function
From what I can see the argument list for update/create_function
(https://github.com/nficano/python-lambda/blob/master/aws_lambda/aws_lambda.py#L462) wants use_s3
to be a list of arguments and s3_file
to be a dictionary of keyword arguments. These two values should be a boolean and a string, and when I changed the code to use them as such everything is working fine for me.
- Getting data from the
event
parameter in the handler function did not work
I had to change the code to something like this:
url = json.loads(event.get('body')).get('url')
Are the changes I had to do due to something strange on my system, or are these actually bugs?
I'm using Python 3.6, and have not tested this on any other Python versions.
Hmm, weird. Let me see if I can replicate these issues. I did not run into them when I submitted this feature but I wouldn't be surprised if I messed something up.