1 00:00:00,140 --> 00:00:01,350 ‫So, so far in this course 2 00:00:01,350 --> 00:00:03,920 ‫we have been doing some pretty simple Lambda functions. 3 00:00:03,920 --> 00:00:06,430 ‫Just some code, no external dependencies. 4 00:00:06,430 --> 00:00:07,263 ‫In the real world, 5 00:00:07,263 --> 00:00:09,560 ‫you definitely need to add more dependencies 6 00:00:09,560 --> 00:00:10,970 ‫with the packages and so on. 7 00:00:10,970 --> 00:00:13,700 ‫And so if your Lambda function depends on extra libraries 8 00:00:13,700 --> 00:00:17,110 ‫for example, the X-Ray SDK, Database Clients, et cetera. 9 00:00:17,110 --> 00:00:19,170 ‫Then you need to install the packages together 10 00:00:19,170 --> 00:00:21,810 ‫alongside your code and zip it all together. 11 00:00:21,810 --> 00:00:24,423 ‫So if you know JS, you can use the NPM 12 00:00:24,423 --> 00:00:26,380 ‫and the node_modules directory. 13 00:00:26,380 --> 00:00:27,213 ‫For Python, 14 00:00:27,213 --> 00:00:29,650 ‫you can use the PIP management as target options. 15 00:00:29,650 --> 00:00:30,483 ‫For Java, 16 00:00:30,483 --> 00:00:31,620 ‫you can include their relevant .jar file. 17 00:00:31,620 --> 00:00:34,070 ‫So each language has its own way of packaging 18 00:00:34,070 --> 00:00:35,040 ‫the dependencies. 19 00:00:35,040 --> 00:00:36,140 ‫But what you need to remember 20 00:00:36,140 --> 00:00:37,700 ‫is that you zip it all together. 21 00:00:37,700 --> 00:00:40,180 ‫So the code and the dependencies together 22 00:00:40,180 --> 00:00:41,500 ‫you zip it all together, 23 00:00:41,500 --> 00:00:44,610 ‫and then you upload the zip straight into Lambda 24 00:00:44,610 --> 00:00:46,160 ‫if it's less than 50 megabytes, 25 00:00:46,160 --> 00:00:48,740 ‫otherwise first into Amazon S3 26 00:00:48,740 --> 00:00:51,100 ‫and then reference it from Lambda. 27 00:00:51,100 --> 00:00:52,230 ‫What about native libraries? 28 00:00:52,230 --> 00:00:54,130 ‫Well, they first needs to be compiled 29 00:00:54,130 --> 00:00:56,890 ‫on Amazon Linux and then they will work. 30 00:00:56,890 --> 00:00:59,330 ‫And what about the AWS SDK? 31 00:00:59,330 --> 00:01:02,340 ‫Well, by default, the SDK comes with every Lambda function. 32 00:01:02,340 --> 00:01:04,540 ‫So if you're just using the AWS SDK, 33 00:01:04,540 --> 00:01:08,730 ‫you don't need to package the SGK alongside your code. 34 00:01:08,730 --> 00:01:09,980 ‫Okay, so let's go ahead 35 00:01:09,980 --> 00:01:11,980 ‫and do a hands-on to see how that works.