1
00:00:00,420 --> 00:00:08,340
In this video we are going to deploy Node.js lambda function with zip file archives using the ACL commands.

2
00:00:08,610 --> 00:00:13,890
As you remember that we have finished the execution role and create function code and now we are going

3
00:00:13,890 --> 00:00:18,390
to create deployment package with zip function code using these commands.

4
00:00:18,510 --> 00:00:19,980
Let's get started.

5
00:00:20,700 --> 00:00:27,180
So lambda function code consists of the scripts or compiled programs and the dependencies, and we can

6
00:00:27,180 --> 00:00:34,590
use deployment package to deploy our function code to the lambda and lambda supports two types of deployment

7
00:00:34,590 --> 00:00:35,250
packages.

8
00:00:35,340 --> 00:00:39,480
The first one in container image and the second one zip file archives.

9
00:00:39,600 --> 00:00:47,040
We will follow the zip file now and deploy the functions with using the zip file archives in order to

10
00:00:47,040 --> 00:00:49,890
create the deployment package for a zip file archive.

11
00:00:49,920 --> 00:00:56,610
We can use a built in zip file archiving utility tool or other zip file utility tool like seven zip

12
00:00:56,610 --> 00:00:58,170
for our command line tool.

13
00:00:58,200 --> 00:00:59,960
You can choose any of that.

14
00:00:59,970 --> 00:01:05,550
The idea is we should create a zip file archive and there are some limitations using the zip file deployment

15
00:01:05,550 --> 00:01:05,970
package.

16
00:01:05,970 --> 00:01:13,320
For example, if the zip file is larger than 50 megabyte, we recommend to uploading it to function

17
00:01:13,320 --> 00:01:18,240
from the Amazon S3 simple search service we will see in the upcoming lectures.

18
00:01:18,240 --> 00:01:25,440
But now we have very basic index case file so that we can zip archive file using the zip commands.

19
00:01:25,620 --> 00:01:31,260
The zip file contains our function code and dependencies used to run our function called lambda.

20
00:01:31,260 --> 00:01:37,200
If our function depends on the standard libraries or HDC libraries, we don't need to include these

21
00:01:37,200 --> 00:01:43,320
libraries in our zip file, but these libraries are included with the supported lambda runtime environment.

22
00:01:43,350 --> 00:01:48,960
This is one of the good features of Lambda when it comes to interact with other resources with using

23
00:01:48,960 --> 00:01:52,320
the SDK we will see in the upcoming lectures.

24
00:01:52,320 --> 00:01:59,490
So if the depending our function code is depending on the SDK libraries, we don't need to include these

25
00:01:59,490 --> 00:02:01,500
libraries into our zip file.

26
00:02:01,530 --> 00:02:04,680
This will be automatically included from the A list.

27
00:02:04,980 --> 00:02:07,020
Okay, let's get started here.

28
00:02:07,020 --> 00:02:10,920
You can see the our index file and here our function code.

29
00:02:10,920 --> 00:02:14,070
So now we are going to create a deployment package.

30
00:02:14,100 --> 00:02:20,460
We have several ways to create deployment package and we can run the compress zip command or manual

31
00:02:20,460 --> 00:02:21,360
zip command.

32
00:02:21,630 --> 00:02:29,600
You can come to the command text file and see the options that we can use for the making zip archive.

33
00:02:29,610 --> 00:02:37,620
This function code in the Mac, we can use zip command and pasting the function that zip or placing

34
00:02:37,620 --> 00:02:39,870
the index case file in windows.

35
00:02:39,870 --> 00:02:48,060
We can use compress this archive, but this function doesn't provide to hierarchical hierarchical dependencies,

36
00:02:48,060 --> 00:02:51,840
so it is good for only one index case file.

37
00:02:51,840 --> 00:02:58,320
But in the upcoming years we will see some hierarchical deployment package that is not covering from

38
00:02:58,320 --> 00:03:00,600
the windows and manual.

39
00:03:00,600 --> 00:03:08,430
It is the most guaranteed way we can go to index JS file and right click Santa compress zip folder.

40
00:03:08,700 --> 00:03:09,060
Okay.

41
00:03:09,060 --> 00:03:17,250
Now I'm going to use the second way since we have one index case file, we can basically compress archive

42
00:03:17,370 --> 00:03:19,440
are using to compress archive command.

43
00:03:19,470 --> 00:03:23,370
I'm using the Windows operating system, so that's why I'm using this command.

44
00:03:23,370 --> 00:03:28,980
You can use this zip command or make it manual for the zip archive file.

45
00:03:29,100 --> 00:03:35,490
Okay, go to the lecture 48 and run this command and the same directory of the index case.

46
00:03:35,490 --> 00:03:38,550
I'm pasting this command and hit the enter.

47
00:03:39,660 --> 00:03:40,200
Okay.

48
00:03:40,200 --> 00:03:47,700
So as you can see that the function that the file is created successfully and you can right click and

49
00:03:47,700 --> 00:03:55,910
go to lecture 48 and see that we have a zip file, which is a function code, including the index JS

50
00:03:55,920 --> 00:03:56,460
file.

51
00:03:56,640 --> 00:03:58,000
Okay, very good.

52
00:03:58,020 --> 00:04:06,210
Now it is ready for the deploy to the lambda and we have verified that we created the files for deploying

53
00:04:06,210 --> 00:04:06,990
lambda function.

54
00:04:06,990 --> 00:04:10,560
And this zip file is ready to upload a lambda environment.
