HashBr0wn
HashBr0wn

Reputation: 467

boto3 Lambda create_function

I have a zip file containing my lambda handler, but I don't know how to specify it as part of the Code parameter. The documentation says to use a ZipFile entry in the Code dictionary parameter, but how am I supposed to convert the zip file I have into "the base64 encoded contents"?

Here is the link to the doc

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.create_function

Thanks for any help!

Upvotes: 0

Views: 1036

Answers (1)

jellycsc
jellycsc

Reputation: 12359

No, you don't need to encode it yourself, boto3 handles it for you.

ZipFile (bytes) -- The base64-encoded contents of the deployment package. AWS SDK and AWS CLI clients handle the encoding for you.

Check out some examples here.

Upvotes: 1

Related Questions