How do I migrate a Lambda function to another AWS account or Region using the Lambda console?
Last updated: 2021-02-03
I need to move an AWS Lambda function from one AWS account (or AWS Region) to another. How can I make those migrations using the Lambda console?
To migrate a Lambda function to another AWS account or AWS Region using the Lambda console, do the following:
1. Download the Lambda function’s deployment package.
2. Use the Lambda function’s deployment package to create a new Lambda function in another AWS account or Region.
Download the Lambda function’s deployment package
1. In the Lambda console, choose Functions in the left panel.
2. Choose the name of the Lambda function you want to migrate.
3. In the top right of the Lambda function window, choose the Actions dropdown, and then select Export Function.
4. In the Export Function window, choose Download deployment package.
Use the Lambda function’s deployment package to create a new Lambda function in another AWS account or Region
Note: The deployment package contains only the Lambda function’s code. The rest of your function’s configurations, such as timeout and memory size, must be entered manually in the console when you create the new function. To migrate all your function’s code and configurations automatically, you can use an AWS SAM file.
1. In a new window, open the Lambda console using the AWS account that you want to migrate your function to.
Use the same AWS account, and then choose the AWS Region you want to migrate your function to.
Important: To create the new function, you must provide your function's name, runtime, and execution role.
3. After the function is created, choose the Code tab.
4. In the top right of the Code source window, choose Upload from.
5. Choose .zip file and then choose Upload.
Note: If the deployment package that you downloaded is larger than 10 MB, you must upload the package to an Amazon Simple Storage Service (Amazon S3) bucket first. Then, choose Amazon S3 location instead of .zip file for step 5.
6. Choose the Lambda function's deployment package that you downloaded previously.
7. Choose Save.
8. Configure the new Lambda function’s settings to match the function that you’re migrating.
9. Invoke the function manually to test it.