1
00:00:00,150 --> 00:00:04,980
In this video, we are going to deploy lambda function with uploading zip files.

2
00:00:05,550 --> 00:00:11,460
First of all, we should refactor our 100 method according to deployment of the lambda function.

3
00:00:11,700 --> 00:00:17,730
For example, I don't want to hardcoded the bucket name because it is come with the event.

4
00:00:17,730 --> 00:00:24,570
So if you go to S3 event JSON file, this is the incoming event from the Amazon S3 asynchronously.

5
00:00:24,600 --> 00:00:30,690
If you scroll down, we can get the bucket name from the records S3 bucket name.

6
00:00:30,750 --> 00:00:36,600
So we will use these objects structure into our indexes for that purpose.

7
00:00:36,600 --> 00:00:42,900
I'm going to comment hardcoded value and place these event records.

8
00:00:42,990 --> 00:00:44,220
S3 Bucket name.

9
00:00:45,000 --> 00:00:46,320
Okay, very good.

10
00:00:46,410 --> 00:00:53,280
So after that, if you remember that, if you go at the end of this file, we call these one methods

11
00:00:53,310 --> 00:00:56,970
to to avoid the recursive invocations.

12
00:00:56,970 --> 00:01:00,310
Make sure that you have commanded this 100 method.

13
00:01:00,330 --> 00:01:06,840
It is very important we activate these 100 method in order to perform local test and verify our business

14
00:01:06,840 --> 00:01:07,350
logic.

15
00:01:07,350 --> 00:01:12,000
But after that, when you deploy your codes, you should command these handed methods.

16
00:01:12,120 --> 00:01:17,370
Okay, now we are ready to deploy our function into the lambda function.

17
00:01:17,370 --> 00:01:21,970
We should start compress and zip our Node.js lambda function.

18
00:01:21,990 --> 00:01:28,530
As you remember that we are developing lambda function with Node.js 16 machine and using a HDC JavaScript

19
00:01:28,530 --> 00:01:31,440
version three with Eclipse six standards.

20
00:01:31,440 --> 00:01:38,190
So since we used a Syrian Dynamo DB SDK package, we should compress and zip the whole Node.js project

21
00:01:38,190 --> 00:01:39,300
as a lambda function.

22
00:01:39,300 --> 00:01:46,410
So this lecture folder will be the our whole Node.js application that we are going to compress and zip

23
00:01:46,410 --> 00:01:49,350
this file and upload to the environment.

24
00:01:49,350 --> 00:01:53,900
So let's right click and go to reveal in Explorer.

25
00:01:53,910 --> 00:02:01,140
So go to these folder structure and copy all commands, all items and remove one by one.

26
00:02:01,140 --> 00:02:09,180
For example, we don't need the commands and also we don't need to event object and that's all I think

27
00:02:09,180 --> 00:02:15,030
we need the dynamo DB Client, S3 client indexes package, JSON and Node.js model.

28
00:02:15,030 --> 00:02:20,220
So okay, let me right click and send to zipped.

29
00:02:26,020 --> 00:02:26,890
Okay.

30
00:02:30,510 --> 00:02:33,660
We can give the name as a street function.

31
00:02:35,830 --> 00:02:41,530
And this is the zip file that we are going to upload on the environment for that purpose.

32
00:02:41,560 --> 00:02:49,510
Go to the HDD function and open the function page and click the upload from upload zip file and clicked

33
00:02:49,510 --> 00:02:50,320
upload button.

34
00:02:50,560 --> 00:02:52,930
So please go to required section.

35
00:02:53,200 --> 00:02:59,410
We are going to use this S3 function zip file open and click this button.

36
00:02:59,440 --> 00:03:04,520
This will be an upload or Node.js application into a lambda.

37
00:03:04,660 --> 00:03:10,930
Okay, we uploaded the codes, but this time, as you can see that there is no codes because our project

38
00:03:10,930 --> 00:03:14,200
is too large to enable inline code editing.

39
00:03:14,200 --> 00:03:16,300
So that's why it is showing this message.

40
00:03:16,300 --> 00:03:19,630
But our codes deployed, uploaded successfully.
