‫So, so far in this course
‫we have been doing some pretty simple Lambda functions.
‫Just some code, no external dependencies.
‫In the real world,
‫you definitely need to add more dependencies
‫with the packages and so on.
‫And so if your Lambda function depends on extra libraries
‫for example, the X-Ray SDK, Database Clients, et cetera.
‫Then you need to install the packages together
‫alongside your code and zip it all together.
‫So if you know JS, you can use the NPM
‫and the node_modules directory.
‫For Python,
‫you can use the PIP management as target options.
‫For Java,
‫you can include their relevant .jar file.
‫So each language has its own way of packaging
‫the dependencies.
‫But what you need to remember
‫is that you zip it all together.
‫So the code and the dependencies together
‫you zip it all together,
‫and then you upload the zip straight into Lambda
‫if it's less than 50 megabytes,
‫otherwise first into Amazon S3
‫and then reference it from Lambda.
‫What about native libraries?
‫Well, they first needs to be compiled
‫on Amazon Linux and then they will work.
‫And what about the AWS SDK?
‫Well, by default, the SDK comes with every Lambda function.
‫So if you're just using the AWS SDK,
‫you don't need to package the SGK alongside your code.
‫Okay, so let's go ahead
‫and do a hands-on to see how that works.