4

I am no longer able to edit my AWS lambda function using the inline editor because of the error, "Your inline editor code size is too large. Maximum size is 51200." Yet, I can't find a walk-through that explains how to do these things from localhost:

  1. Upload a python script to Lambda
  2. Supply "event" data to the script
  3. View Lambda output
user3303554
  • 2,215
  • 2
  • 16
  • 16

1 Answers1

3

You'll need to create a deployment package for your code, which is just a zip archive but with a particular format. Instructions are in the AWS Python deployment documentation.

Then you can use the context object to supply event data to your script, starter information in the AWS Python programming model documentation.

Side note: once your Lambda code starts to get larger, it's often handy to move to some sort of management framework. Several have been written for Lambda, I use Apex which is written in Go but works for any Lambda code, but you might be more comfortable with Gordon (has a great list of examples and is more active) or Kappa, which are both written in Python.

ocean
  • 1,335
  • 15
  • 26
  • 1
    Thanks ocean! For others who have this challenge, the AWS instructions leave out some important steps but was able to find answers elsewhere, including this post: http://stackoverflow.com/questions/35340921/aws-lambda-import-module-error-in-python/38344019#38344019 . – user3303554 Jul 13 '16 at 06:30
  • I ended up writing a script that takes these steps: 1. Open my lambda script 2. Use Boto3 to load the binary into the "update_function_code" method 3. Use Boto3 to execute "invoke" method to run the updated function 4. Read the 'Payload' portion of the response to display to the console. If people want more details, feel free to ask. – user3303554 Jul 13 '16 at 06:31