user3303554
user3303554

Reputation: 2335

AWS Lambda: How To Upload & Test Code Using Python And Command Line

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

Upvotes: 4

Views: 6171

Answers (1)

ocean
ocean

Reputation: 1350

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.

Upvotes: 3

Related Questions