1 00:00:00,080 --> 00:00:02,410 ‫Okay, so now let's talk about Lambda Layers. 2 00:00:02,410 --> 00:00:03,940 ‫They're a newer feature of Lambda, 3 00:00:03,940 --> 00:00:06,110 ‫and they allow us to do two things. 4 00:00:06,110 --> 00:00:09,290 ‫Number one is to create custom run times for Lambda. 5 00:00:09,290 --> 00:00:11,050 ‫So that means languages that are not meant 6 00:00:11,050 --> 00:00:12,350 ‫for Lambda initially, 7 00:00:12,350 --> 00:00:14,550 ‫but that the community has decided to support 8 00:00:14,550 --> 00:00:15,930 ‫through Lambda Layers. 9 00:00:15,930 --> 00:00:18,810 ‫So we have C++, and we have Rust, for example. 10 00:00:18,810 --> 00:00:20,920 ‫So these are two examples that allow you 11 00:00:20,920 --> 00:00:23,170 ‫to use a C++ language or the Rust language 12 00:00:23,170 --> 00:00:24,980 ‫onto Lambda functions. 13 00:00:24,980 --> 00:00:28,430 ‫The other more common use case for Lambda Layers 14 00:00:28,430 --> 00:00:32,040 ‫is to externalize dependencies in order to reuse them. 15 00:00:32,040 --> 00:00:35,280 ‫So, if we look at a zipped application package, 16 00:00:35,280 --> 00:00:37,200 ‫it could be pretty big, we have a Lambda function 17 00:00:37,200 --> 00:00:39,440 ‫and there'd be some heavy libraries, heavy dependencies. 18 00:00:39,440 --> 00:00:41,320 ‫And so that's maybe 30 megabytes. 19 00:00:41,320 --> 00:00:43,690 ‫And we saw that to update another function, 20 00:00:43,690 --> 00:00:47,570 ‫we need to re-upload that zip over and over and over again. 21 00:00:47,570 --> 00:00:48,660 ‫So that would mean that every time 22 00:00:48,660 --> 00:00:51,460 ‫we repack your application and re-upload everything, 23 00:00:51,460 --> 00:00:55,330 ‫but sometimes the dependencies we're using are not changing 24 00:00:55,330 --> 00:00:57,430 ‫or are changing very, very, very slowly. 25 00:00:57,430 --> 00:00:59,600 ‫And so it would be better to externalize them 26 00:00:59,600 --> 00:01:01,550 ‫into what's called a layer. 27 00:01:01,550 --> 00:01:03,980 ‫So the goal is to have your application package 28 00:01:03,980 --> 00:01:05,440 ‫which is what you could change very, 29 00:01:05,440 --> 00:01:07,500 ‫very often your code externalize. 30 00:01:07,500 --> 00:01:10,380 ‫So this has maybe 20 kilobytes, so very, very small. 31 00:01:10,380 --> 00:01:13,910 ‫{\an8}And then you have created layers for your heavy libraries. 32 00:01:13,910 --> 00:01:16,300 ‫{\an8}So you've created a first and then the layer of 10 megabyte 33 00:01:16,300 --> 00:01:18,840 ‫{\an8}the second limited layer of 30 megabytes 34 00:01:18,840 --> 00:01:23,370 ‫{\an8}and these layers together can be referencing your function 35 00:01:23,370 --> 00:01:25,530 ‫{\an8}and sorry your functioning can be referencing your layers, 36 00:01:25,530 --> 00:01:28,530 ‫{\an8}obviously, and therefore we have a much faster way to 37 00:01:28,530 --> 00:01:29,600 ‫{\an8}deploy our functions 38 00:01:29,600 --> 00:01:32,680 ‫{\an8}and we don't need to repackage every time our dependencies 39 00:01:32,680 --> 00:01:36,030 ‫{\an8}and because our layers are externalized, another function 40 00:01:36,030 --> 00:01:39,370 ‫{\an8}another application package could create another function 41 00:01:39,370 --> 00:01:42,530 ‫{\an8}maybe 60 kilobytes and reference these, same layers. 42 00:01:42,530 --> 00:01:43,690 ‫{\an8}So this the whole purpose 43 00:01:43,690 --> 00:01:46,790 ‫{\an8}we are packaging our application dependencies and layers 44 00:01:46,790 --> 00:01:49,170 ‫{\an8}and we can reuse them across Lynda functions. 45 00:01:49,170 --> 00:01:51,553 ‫{\an8}Now let's go in the hands-on to see how that works.