In this video we are going to deploy Node.js lambda function with zip file archives using the ACL commands.
As you remember that we have finished the execution role and create function code and now we are going
to create deployment package with zip function code using these commands.
Let's get started.
So lambda function code consists of the scripts or compiled programs and the dependencies, and we can
use deployment package to deploy our function code to the lambda and lambda supports two types of deployment
packages.
The first one in container image and the second one zip file archives.
We will follow the zip file now and deploy the functions with using the zip file archives in order to
create the deployment package for a zip file archive.
We can use a built in zip file archiving utility tool or other zip file utility tool like seven zip
for our command line tool.
You can choose any of that.
The idea is we should create a zip file archive and there are some limitations using the zip file deployment
package.
For example, if the zip file is larger than 50 megabyte, we recommend to uploading it to function
from the Amazon S3 simple search service we will see in the upcoming lectures.
But now we have very basic index case file so that we can zip archive file using the zip commands.
The zip file contains our function code and dependencies used to run our function called lambda.
If our function depends on the standard libraries or HDC libraries, we don't need to include these
libraries in our zip file, but these libraries are included with the supported lambda runtime environment.
This is one of the good features of Lambda when it comes to interact with other resources with using
the SDK we will see in the upcoming lectures.
So if the depending our function code is depending on the SDK libraries, we don't need to include these
libraries into our zip file.
This will be automatically included from the A list.
Okay, let's get started here.
You can see the our index file and here our function code.
So now we are going to create a deployment package.
We have several ways to create deployment package and we can run the compress zip command or manual
zip command.
You can come to the command text file and see the options that we can use for the making zip archive.
This function code in the Mac, we can use zip command and pasting the function that zip or placing
the index case file in windows.
We can use compress this archive, but this function doesn't provide to hierarchical hierarchical dependencies,
so it is good for only one index case file.
But in the upcoming years we will see some hierarchical deployment package that is not covering from
the windows and manual.
It is the most guaranteed way we can go to index JS file and right click Santa compress zip folder.
Okay.
Now I'm going to use the second way since we have one index case file, we can basically compress archive
are using to compress archive command.
I'm using the Windows operating system, so that's why I'm using this command.
You can use this zip command or make it manual for the zip archive file.
Okay, go to the lecture 48 and run this command and the same directory of the index case.
I'm pasting this command and hit the enter.
Okay.
So as you can see that the function that the file is created successfully and you can right click and
go to lecture 48 and see that we have a zip file, which is a function code, including the index JS
file.
Okay, very good.
Now it is ready for the deploy to the lambda and we have verified that we created the files for deploying
lambda function.
And this zip file is ready to upload a lambda environment.