1
00:00:00,270 --> 00:00:07,170
In this video, we are going to create a lambda function with a zip file using the SQL commands.

2
00:00:07,500 --> 00:00:12,090
So we will create a lambda function with using the create function command.

3
00:00:12,630 --> 00:00:14,970
So let's check the documentation.

4
00:00:15,180 --> 00:00:18,260
It is good to understand this command.

5
00:00:18,270 --> 00:00:22,140
So here you can find a standard slide reference documentation.

6
00:00:22,140 --> 00:00:30,450
And if we saw in here, if you scroll down, we can see that the great function command is in here.

7
00:00:30,840 --> 00:00:34,930
If you come to create function command, you can see the documentation.

8
00:00:34,950 --> 00:00:38,070
Basically, this command creates a lambda function.

9
00:00:38,220 --> 00:00:42,840
In order to create a function, we need a deployment package and execution role.

10
00:00:43,200 --> 00:00:48,990
The deployment package is a zip file archive that contains our function code that we already do in the

11
00:00:48,990 --> 00:00:49,830
last section.

12
00:00:50,100 --> 00:00:57,450
And we also need to execution grants the function permission to use a services such as Amazon Cloud

13
00:00:57,450 --> 00:01:01,710
Watch logs for log streaming and x ray for request raising.

14
00:01:02,040 --> 00:01:04,770
And we also create an execution role in the last lectures.

15
00:01:04,770 --> 00:01:09,210
So that means we are ready to create lambda function with using the commands.

16
00:01:09,240 --> 00:01:15,270
If you scroll down this documentation, you can see all the details and options when creating lambda

17
00:01:15,270 --> 00:01:17,620
functions using the commands.

18
00:01:17,640 --> 00:01:19,110
If you scroll down.

19
00:01:20,800 --> 00:01:24,380
You can see the detailed parameters in here.

20
00:01:24,400 --> 00:01:27,610
For example, if I can search function name.

21
00:01:29,830 --> 00:01:30,310
Yes.

22
00:01:30,310 --> 00:01:32,800
Here you can find all the options in here.

23
00:01:32,800 --> 00:01:37,210
Function, name, function, Aaron and runtime zip file.

24
00:01:37,240 --> 00:01:43,600
You can see all options in here and the role parameter, you can see that we should also have the zip

25
00:01:43,600 --> 00:01:51,010
file and the role parameter in here and we will specify this parameter when running this command.

26
00:01:51,160 --> 00:01:54,670
And the role parameter needs to run name of the role.

27
00:01:54,670 --> 00:02:00,460
So that's why before running this command we should get the role Aaron name to pass this function.

28
00:02:00,610 --> 00:02:07,570
To do that, please open the pseudocode and create a new lecture folder and create command section.

29
00:02:07,570 --> 00:02:10,150
And here is the documentation you can check in here.

30
00:02:10,180 --> 00:02:14,140
And now I'm going to get our execution role.

31
00:02:14,170 --> 00:02:20,140
Role name was Lambda Dash X, so we shall get the roll error name.

32
00:02:20,230 --> 00:02:21,160
To do that.

33
00:02:21,160 --> 00:02:29,050
I'm going to write a place I am, get this role command specifying to our newly created role name and

34
00:02:29,050 --> 00:02:30,130
hit the enter.

35
00:02:31,340 --> 00:02:34,330
This will be get all the details about road.

36
00:02:34,340 --> 00:02:38,180
You can see the road name, road ID and then you can copy this.

37
00:02:38,180 --> 00:02:41,600
Aaron And we will specify and pass these.

38
00:02:41,600 --> 00:02:45,940
Aaron to the great Neve Lambda Function Command.

39
00:02:45,950 --> 00:02:49,070
So for that purpose, I'm going to get these.

40
00:02:49,100 --> 00:02:51,380
Aaron, you can copy in here.

41
00:02:53,060 --> 00:02:58,040
And paste our Aaron name after that.

42
00:02:58,190 --> 00:03:02,150
Now we are ready for the run the crate lambda function command.

43
00:03:02,180 --> 00:03:08,240
To do that, let me clear and copy for the crate function command.

44
00:03:08,570 --> 00:03:10,100
We can see in here.

45
00:03:10,100 --> 00:03:12,890
I'm using the windows and multi-line characters.

46
00:03:12,890 --> 00:03:18,980
You can use the make a command in here and copy this line of code and paste in here.

47
00:03:18,980 --> 00:03:25,100
So basically we are using the Lambda Crate Function Command and specifying the function name.

48
00:03:25,100 --> 00:03:28,460
I'm going to create a new function which is my dash function tool.

49
00:03:28,550 --> 00:03:30,380
Runtime will be the Node.js.

50
00:03:30,440 --> 00:03:35,210
The file is a function zip file handler will be the index.

51
00:03:35,220 --> 00:03:39,590
Third row name should be the run of the our run name.

52
00:03:39,590 --> 00:03:43,070
But before that I forgot to copy our zip file.

53
00:03:43,100 --> 00:03:51,710
Please copy function zip file from the previous lecture and paste into the in here which is the lecture

54
00:03:51,710 --> 00:03:52,670
49.

55
00:03:52,670 --> 00:03:59,210
So now this command will be worked because we are specifying the zip file in the same directory and

56
00:03:59,210 --> 00:04:05,660
I'm using the director of the lecture 49 so after copy and paste this command hit the enter and this

57
00:04:05,660 --> 00:04:09,080
will be create a new function into our address.

58
00:04:09,560 --> 00:04:12,260
Yes, function is created successfully.

59
00:04:12,290 --> 00:04:14,570
You can see the function that is in here.

60
00:04:14,720 --> 00:04:22,100
So if you click the enter, you can see the all details about the function in the JSON response of the

61
00:04:22,220 --> 00:04:23,810
a command.

62
00:04:23,960 --> 00:04:27,410
To verify this, please open the command window.

63
00:04:28,360 --> 00:04:30,700
And come to the lumbar section.

64
00:04:32,350 --> 00:04:39,910
And functions see that I have need to create my function to is created from the commands in the code

65
00:04:39,910 --> 00:04:40,340
window.

66
00:04:40,360 --> 00:04:48,130
You can see that the code is the or default code that we create from the indexes and archive with the

67
00:04:48,150 --> 00:04:48,910
zip file.

68
00:04:49,000 --> 00:04:54,910
So as you can see that we have successfully create a lambda function with zip file using the alias select

69
00:04:54,970 --> 00:04:55,540
command.
