<div dir="ltr">A couple months ago I put together a CodeBuild project for building cryptography for just this type of use.  I was specifically targeting building against (and packaging) a newer version of OpenSSL than is present on Lambda, but it solves the general problem of building it as part of that.  You should be able to lightly modify the buildspec to just package up the wheel files, or you could use this as the basis for your own buildspec, of which the cryptography build is only a part.<div><br></div><div><a href="https://github.com/mattsb42/codebuild-python-cryptography-custom-openssl">https://github.com/mattsb42/codebuild-python-cryptography-custom-openssl</a><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 4, 2017 at 9:28 AM Paul Kehrer <<a href="mailto:paul.l.kehrer@gmail.com">paul.l.kehrer@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div id="m_8589753390109935999bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto" class="gmail_msg">That lamba-packages project looks like an approach that would work. The error you describe in your issue is because you'll need to separately install cryptography's dependencies. You can see those dependencies by looking in setup.py (although you'll need to evaluate some Python code in your head). The current version of cryptography (1.8.1) has slightly different dependencies so you'll need to look at the setup.py in that tarball.</div></div><div style="word-wrap:break-word" class="gmail_msg"> <br class="gmail_msg"> <div id="m_8589753390109935999bloop_sign_1491320467768064000" class="m_8589753390109935999bloop_sign gmail_msg"></div> <br class="gmail_msg"><p class="m_8589753390109935999airmail_on gmail_msg">On April 4, 2017 at 8:14:40 PM, Francesco Rizzi (<a href="mailto:francesco.rizzi@gmail.com" class="gmail_msg" target="_blank">francesco.rizzi@gmail.com</a>) wrote:</p> <blockquote type="cite" class="m_8589753390109935999clean_bq gmail_msg"><span class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg">





<div dir="ltr" class="gmail_msg">Hi all.
<div class="gmail_msg">I've been trying to get a build of cryptography targeting the
AWS Linux AMI used by AWS Lambda (AMIs listed on <a href="https://aws.amazon.com/amazon-linux-ami/" class="gmail_msg" target="_blank">https://aws.amazon.com/amazon-linux-ami/</a>
), but failed repeatedly.</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Has anyone done so already? Or could try?</div>
<div class="gmail_msg"><br class="gmail_msg">
I also found a "Lambda-Packages" github ( <a href="https://github.com/Miserlou/lambda-packages" class="gmail_msg" target="_blank">https://github.com/Miserlou/lambda-packages</a>
) that seems to include cryptography pre-built for that target, but
that also lead to errors ( <a href="https://github.com/Miserlou/lambda-packages/issues/41" class="gmail_msg" target="_blank">https://github.com/Miserlou/lambda-packages/issues/41</a>
)</div>
<div class="gmail_msg"><br class="gmail_msg"></div>
<div class="gmail_msg">Thanks in advance,<br class="gmail_msg">
FR</div>
</div>


_______________________________________________
<br class="gmail_msg">Cryptography-dev mailing list
<br class="gmail_msg"><a href="mailto:Cryptography-dev@python.org" class="gmail_msg" target="_blank">Cryptography-dev@python.org</a>
<br class="gmail_msg"><a href="https://mail.python.org/mailman/listinfo/cryptography-dev" class="gmail_msg" target="_blank">https://mail.python.org/mailman/listinfo/cryptography-dev</a>
<br class="gmail_msg"></div></div></span></blockquote></div>
_______________________________________________<br class="gmail_msg">
Cryptography-dev mailing list<br class="gmail_msg">
<a href="mailto:Cryptography-dev@python.org" class="gmail_msg" target="_blank">Cryptography-dev@python.org</a><br class="gmail_msg">
<a href="https://mail.python.org/mailman/listinfo/cryptography-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://mail.python.org/mailman/listinfo/cryptography-dev</a><br class="gmail_msg">
</blockquote></div></div>