question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Documentation incorrect for Lambda's create_function

See original GitHub issue

I’ve been trying to use Lambda’s create_function by supplying a zip as an argument Code={'ZipFile': ...}, but have encountered problems with the documentation.

The documentation says: ZipFile (bytes) -- A base64-encoded .zip file containing your deployment package. For more information about creating a .zip file, go to Execution Permissions in the AWS Lambda Developer Guide .

Two problems I encountered:

  1. Did not work when encoding zip in base64, but instead worked when I passed the bytes directly.
  2. The page linked to (Execution Permissions) does not even contain the word zip

I’m guessing boto instead encodes the file to base64 itself?

thanks

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

21reactions
ryantuckcommented, May 29, 2016

for anyone stumbling on this late, syntax looks like:

import os
import boto3

boto3.client('lambda').create_function(
    ... ,
    Code={
        'ZipFile': open('my_file.zip', 'rb').read()
        },
    ...
)
0reactions
hushenbegcommented, Sep 17, 2020

Thank you @ryantuck !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot deployment issues in Lambda
Deployment errors prevent the new version from being used and can arise from issues with your deployment package, code, permissions, or tools. When...
Read more >
bug: Incorrect ARN for lambda function · Issue #5147
Cross-region support and Lambda function usage should be documented somehow. If I specified a region(us-west-1) using AWS_REGION environment ...
Read more >
Testing AWS Lambda functions locally - invalid ...
According to the aws-lambda-local docs, there is no -l option. Use -f or --function to specify the file with the lambda function.
Read more >
LAMBDA function
If an incorrect number of arguments is passed to a LAMBDA function, Excel returns a #VALUE! error. If you call a LAMBDA function...
Read more >
Build functions
Create function file ... Because Netlify Functions are powered by AWS Lambda, AWS's environment property limits apply to environment variables used with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found