In this video, we are going to deploy lambda function with uploading zip files.
First of all, we should refactor our 100 method according to deployment of the lambda function.
For example, I don't want to hardcoded the bucket name because it is come with the event.
So if you go to S3 event JSON file, this is the incoming event from the Amazon S3 asynchronously.
If you scroll down, we can get the bucket name from the records S3 bucket name.
So we will use these objects structure into our indexes for that purpose.
I'm going to comment hardcoded value and place these event records.
S3 Bucket name.
Okay, very good.
So after that, if you remember that, if you go at the end of this file, we call these one methods
to to avoid the recursive invocations.
Make sure that you have commanded this 100 method.
It is very important we activate these 100 method in order to perform local test and verify our business
logic.
But after that, when you deploy your codes, you should command these handed methods.
Okay, now we are ready to deploy our function into the lambda function.
We should start compress and zip our Node.js lambda function.
As you remember that we are developing lambda function with Node.js 16 machine and using a HDC JavaScript
version three with Eclipse six standards.
So since we used a Syrian Dynamo DB SDK package, we should compress and zip the whole Node.js project
as a lambda function.
So this lecture folder will be the our whole Node.js application that we are going to compress and zip
this file and upload to the environment.
So let's right click and go to reveal in Explorer.
So go to these folder structure and copy all commands, all items and remove one by one.
For example, we don't need the commands and also we don't need to event object and that's all I think
we need the dynamo DB Client, S3 client indexes package, JSON and Node.js model.
So okay, let me right click and send to zipped.
Okay.
We can give the name as a street function.
And this is the zip file that we are going to upload on the environment for that purpose.
Go to the HDD function and open the function page and click the upload from upload zip file and clicked
upload button.
So please go to required section.
We are going to use this S3 function zip file open and click this button.
This will be an upload or Node.js application into a lambda.
Okay, we uploaded the codes, but this time, as you can see that there is no codes because our project
is too large to enable inline code editing.
So that's why it is showing this message.
But our codes deployed, uploaded successfully.