Lambda container approach in AWS

Zip vs Container Approach

There are two ways to use Lambda functions in AWS. One is to provide the deployable artifact in the form of a zip file. You then have a variety of runtimes you can choose from: https://docs.aws.amazon.com/lambda/lat…


This content originally appeared on DEV Community and was authored by DH Kim

Zip vs Container Approach

There are two ways to use Lambda functions in AWS. One is to provide the deployable artifact in the form of a zip file. You then have a variety of runtimes you can choose from: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html.

The other approach is the Lambda container approach. IMO, the container approach to Lambda management has two main advantages over the zip approach.

Runtime selection

With the zip approach, you have to rely on Amazon supporting the desired runtime. For example, if your code depends on Python3.10, you better hope that Amazon supports that. In a container approach however, the runtime is something you have full control over. Just make sure either your base image supports the runtime or you install the runtime as part of one of your RUN statements.

Building dependencies

Non-native packages such as pandas, lxml, etc have to be built in the target environment for the compiled binaries to work. For example, if you build pandas on Mac, then the compiled binaries will work on Mac - not on Amazon Linux 2 which is what Lambda runs on.

With containers, you no longer have to worry about building for a target OS, as you're able to encapsulate OS details in an image. Put simply, the image you build locally will just work in Lambda. How easy is that!


This content originally appeared on DEV Community and was authored by DH Kim


Print Share Comment Cite Upload Translate Updates
APA

DH Kim | Sciencx (2021-11-14T19:28:24+00:00) Lambda container approach in AWS. Retrieved from https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/

MLA
" » Lambda container approach in AWS." DH Kim | Sciencx - Sunday November 14, 2021, https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/
HARVARD
DH Kim | Sciencx Sunday November 14, 2021 » Lambda container approach in AWS., viewed ,<https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/>
VANCOUVER
DH Kim | Sciencx - » Lambda container approach in AWS. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/
CHICAGO
" » Lambda container approach in AWS." DH Kim | Sciencx - Accessed . https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/
IEEE
" » Lambda container approach in AWS." DH Kim | Sciencx [Online]. Available: https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/. [Accessed: ]
rf:citation
» Lambda container approach in AWS | DH Kim | Sciencx | https://www.scien.cx/2021/11/14/lambda-container-approach-in-aws/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.