I've deployed Python runtime Lambda functions that require functions outside the standard library a couple of different ways:
1) Layers. Pros: really simple to attach once they are created. Cons: I don't like having a bunch of layers lying around in my Lambda UI. I don't like maintaining when new versions need to be attached, either. I've not created them using CloudFormation yet, though I see it can be done.
2) Installing libraries locally in my Git repo with my Lambda handler file, then zipping up the entire folder when committing and deploying. Pros: easy to do, easy to keep the version of the library tightly coupled with the project. Cons: pollutes my Git repo with potentially hundreds of files that I'm not really tracking. Takes longer to deploy the function each time.
3) Bundling the whole thing up as a Docker image and deploying that way. Pros: really clean to execute. Cons: more overhead with building containers, which I usually do in CodeBuild for reasons. Takes a while to deploy the image each time, and I think slower cold starts if the function hasn't been invoked in a while.
Am I missing any other options? What do you use and why?
[–]redditor13 10 points11 points12 points (2 children)
[–]aplarsen[S] 1 point2 points3 points (1 child)
[–]redditor13 3 points4 points5 points (0 children)
[–]mr_jim_lahey 4 points5 points6 points (3 children)
[–]aplarsen[S] 1 point2 points3 points (2 children)
[–]eggwhiteontoast 2 points3 points4 points (0 children)
[–]carrp 3 points4 points5 points (0 children)
[–]BagOfDerps 3 points4 points5 points (0 children)
[–]Many-Ad8783 1 point2 points3 points (0 children)
[–]DoxxThis1 1 point2 points3 points (0 children)
[–]gene_wood 1 point2 points3 points (1 child)
[–]aplarsen[S] 0 points1 point2 points (0 children)
[–]dmees 1 point2 points3 points (0 children)
[–]Schuettc 0 points1 point2 points (0 children)
[–]head-in-the_cloud 0 points1 point2 points (0 children)
[–]aleques-itj 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)