4

I'm a little confused about this. If I try to create a new python lambda in the aws console I see this: enter image description here

Now I want to use python 3.6 and I also want to package up some binaries with a virtualenv (I'll have to do this to run the cryptography module).

I'm following this doc:http://docs.aws.amazon.com/lambda/latest/dg/with-s3-example-deployment-pkg.html

So I spun up a new amazon linux ami and tried install python36-devel, like it says in the doc, but it wasn't in the repos. The latest python3 was python35.

So my question is where is AWS lambda getting the python 3.6 interpreter? And where should I install it from on an amazon linux instance in order to create a virtualenv that uses the 3.6 interpreter.

##############Edit:

According to the documentation I was pointed to lambda runs on amzn-ami-hvm-2016.03.3.x86_64-gp2

I launched an instance with that ami and noticed the same thing. Only python35 is in its repos. So how does amazon run 3.6? Is this the wrong ami or do they install the 3.6 interpreter on it a different way?

red888
  • 27,709
  • 55
  • 204
  • 392

2 Answers2

4

According to this, the public AMI for all runtime envs. is amzn-ami-hvm-2016.03.3.x86_64-gp2. You should be able to work with this.

Also make sure the library you are trying to compile is not available out there already, for example at this repo. Finally you may want check this out to find out more tips about how to avoid common problems during Lambda deployments.

joarleymoraes
  • 1,891
  • 14
  • 16
  • I had trouble using their module (I don't want to use Zappa for this), but I'll open a separate post for that problem – red888 May 16 '17 at 02:29
  • You don't need to use Zappa to use those modules. It should work with any regular Lambda deployment. I have tested with the Numpy package a few days ago, and it worked just fine. – joarleymoraes May 16 '17 at 02:31
  • Cryptography relies on openssl libraries and it looks like they install that in a build script which I assume Zappa runs? The errors I got were related to not have openssl stuff installed – red888 May 16 '17 at 02:34
  • Not sure, but as I said, I used the Numpy compiled library with no Zappa. So I think it's worth the shot in your case. – joarleymoraes May 16 '17 at 11:23
0

An alternative is to use the Docker containers that are designed to match the features of the Lambda, in order to allow building compile time dependencies.

https://hub.docker.com/r/lambci/lambda/tags/

There is a Python3.6 tagged version.

Ed Henderson
  • 1,184
  • 1
  • 7
  • 4