In this video, we are going to create a lambda function with a zip file using the SQL commands.
So we will create a lambda function with using the create function command.
So let's check the documentation.
It is good to understand this command.
So here you can find a standard slide reference documentation.
And if we saw in here, if you scroll down, we can see that the great function command is in here.
If you come to create function command, you can see the documentation.
Basically, this command creates a lambda function.
In order to create a function, we need a deployment package and execution role.
The deployment package is a zip file archive that contains our function code that we already do in the
last section.
And we also need to execution grants the function permission to use a services such as Amazon Cloud
Watch logs for log streaming and x ray for request raising.
And we also create an execution role in the last lectures.
So that means we are ready to create lambda function with using the commands.
If you scroll down this documentation, you can see all the details and options when creating lambda
functions using the commands.
If you scroll down.
You can see the detailed parameters in here.
For example, if I can search function name.
Yes.
Here you can find all the options in here.
Function, name, function, Aaron and runtime zip file.
You can see all options in here and the role parameter, you can see that we should also have the zip
file and the role parameter in here and we will specify this parameter when running this command.
And the role parameter needs to run name of the role.
So that's why before running this command we should get the role Aaron name to pass this function.
To do that, please open the pseudocode and create a new lecture folder and create command section.
And here is the documentation you can check in here.
And now I'm going to get our execution role.
Role name was Lambda Dash X, so we shall get the roll error name.
To do that.
I'm going to write a place I am, get this role command specifying to our newly created role name and
hit the enter.
This will be get all the details about road.
You can see the road name, road ID and then you can copy this.
Aaron And we will specify and pass these.
Aaron to the great Neve Lambda Function Command.
So for that purpose, I'm going to get these.
Aaron, you can copy in here.
And paste our Aaron name after that.
Now we are ready for the run the crate lambda function command.
To do that, let me clear and copy for the crate function command.
We can see in here.
I'm using the windows and multi-line characters.
You can use the make a command in here and copy this line of code and paste in here.
So basically we are using the Lambda Crate Function Command and specifying the function name.
I'm going to create a new function which is my dash function tool.
Runtime will be the Node.js.
The file is a function zip file handler will be the index.
Third row name should be the run of the our run name.
But before that I forgot to copy our zip file.
Please copy function zip file from the previous lecture and paste into the in here which is the lecture
49.
So now this command will be worked because we are specifying the zip file in the same directory and
I'm using the director of the lecture 49 so after copy and paste this command hit the enter and this
will be create a new function into our address.
Yes, function is created successfully.
You can see the function that is in here.
So if you click the enter, you can see the all details about the function in the JSON response of the
a command.
To verify this, please open the command window.
And come to the lumbar section.
And functions see that I have need to create my function to is created from the commands in the code
window.
You can see that the code is the or default code that we create from the indexes and archive with the
zip file.
So as you can see that we have successfully create a lambda function with zip file using the alias select
command.