python-lambda icon indicating copy to clipboard operation
python-lambda copied to clipboard

`lambda deploy_s3` not working without changes to aws_lambda.py

Open mipli opened this issue 7 years ago • 1 comments

When I tried to deploy through S3 using lambda deploy_s3 I encountered three issues.

  1. Setting role: basic_s3_upload in config.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.

  1. 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.

  1. 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.

mipli avatar Dec 01 '17 11:12 mipli

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.

slapula avatar Dec 23 '17 05:12 slapula