Hi, everyone, and welcome back.
Now in this video will be exploring the migration related steps associated with Lambda function.
So at this stage, let's assume that you have a lambda function that is running in account one and you
want the same lambda function to be available in account two.
So in order to achieve this, let's look into the overall steps that are involved.
Now, the step number one is related to exporting a function.
So within the first primary step here is to download the Lambda Functions deployment package, and then
you use the Lambda Functions Deployment package to create a new Lambda function in other account or
region.
For example, if you look into the screenshot, you can go ahead and easily export a specific function.
So this is what we are intending to do as part of step one.
And in this step two, in other account or region you can use the upload from and you can upload the
appropriate deployment package zip file and that's the overall step involved.
Now within the there are certain important pointers that you need to keep a note of.
First one is that the deployment package contains only the Lambda functions code.
Very important part to remember second pointer is that the rest of your functions configurations such
as timeout memory size must be entered manually in the console when you create the new function.
So in case if you want to avoid that, if you want to migrate all of your function code and the configuration,
automatically you can use the same file.
So let's go ahead and explore this from a practical point of view.
So let's assume that you have a function here called Key Labs function.
This is a very simple hello from Lambda function, as you can see over here.
So let's assume that you want to migrate it to a different region or different account altogether.
So the first step here is export function.
Now when you export function, there are two options.
You have a deployment package and you have a same file.
So let's use both of them.
We'll use the deployment package as well as the same file.
Now, if you look into the deployment package, let's open the compressed file so you have this index
dot JavaScript, let's open this.
So within here you have your halo from Lambda Code and that's about it.
Your deployment package does not contain any other detail.
Let's go back, let's open up the same file.
Now, if you look into the same file, it contains various other configurations like you have runtime
your code, you write the description, the memory size, the time, timeout, the role and various
others.
And this is the reason why we had discussed that the deployment package contains only the Lambda Functions
code and if you want to migrate the code as well as the configuration, then you can make use of the
same file.
All right.
So this is the first part.
Now, let's say that you want to.
Migrated to a different region.
Let's open up one of the other regions here.
Let's quickly create a lambda function.
I'll just call it s test.
Again, the runtime is node similar to the previous functions runtime grid and all you'll have to do
is here.
You can import this specific zip file.
So here you can upload the zip file and your new code will be ready.
So that's a very high level overview about migrating the lambda function.
And with this will conclude today's video.