Skip to content

How do I use the Lambda console to migrate a function from one AWS account or Region to another?

2 minute read
2

I want to move an AWS Lambda function from one AWS account or AWS Region to another.

Short description

To use the Lambda console to migrate a function to another account or Region, download the function's deployment package. Then, use the Lambda function's deployment package to create a new Lambda function in another account or Region.

Note: You can also use the AWS Command Line Interface (AWS CLI) to migrate a Lambda function to another account or Region. Or, you can use an AWS Serverless Application Model (AWS SAM) file to migrate a Lambda function to another account or Region.

Resolution

Download the Lambda function's deployment package

Note: The deployment package contains only the Lambda function's code. You must manually enter your function configurations such as environment variables, layers, destinations, and permissions 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.

Complete the following steps:

  1. Open the Lambda console.
  2. In the navigation pane, choose Functions, and then select the Lambda function that you want to migrate.
  3. Choose the Download dropdown list, and then select Download function code zip.

Use the Lambda function's deployment package to create a new Lambda function in another AWS account or Region

Complete the following steps:

  1. Open the Lambda console with the account or in the Region that you want to migrate your function to.
  2. Create a new Lambda function.
  3. Choose the Code tab.
  4. Choose the Upload from dropdown list, and choose .zip file.
  5. Choose Upload, and then choose your Lambda function's deployment package that you downloaded previously.
  6. Note: If the downloaded deployment package is larger than 50 MB zipped, then upload it to an Amazon Simple Storage Service (Amazon S3) bucket. Then, choose Amazon S3 location instead of .zip file. Make sure that the Amazon S3 bucket is in the same AWS Region as your Lambda function.
  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 the function.
AWS OFFICIALUpdated 7 months ago