![]() |
AWS Lambda is a serverless computing technology made by Amazon Web Services, that allows one to run a piece of code without any need of maintaining a server. This makes it an ideal choice for various applications, from simple task automation to complex backend services. However, there may be a need to duplicate a lambda function, for any reason, be it testing or version control, etc. In this article, we will see how to duplicate a lambda function. Though there is no specific one-button click process to duplicate a lambda function, it can be achieved by following these steps. How to Duplicate an AWS Lambda Function: Step-By-Step ProcessStep 1: Login into your AWS Console Step 2: Go to the Lambda Dashboard Type “Lambda” inside the search box located inside the top left corner. ![]() Step 3: Select the function to duplicate After heading into the AWS Lambda web page, you will see a list of Lambda Functions which you have created. Select the one that you want to duplicate. I want to duplicate my TestLambda function from my list of Lambda Functions. So i will left-click on the function and head inside it. ![]() Step 4: Note down the function’s configurations. When you are inside your Lambda Function, scroll down and note down the runtime configuration. ![]() Here, my runtime configuration is ‘Python 3.12’ and Architecture is x86_64. Then head into Configurations tab and note the other details such as timeouts, memory triggers, permissions etc. ![]() My lambda function does not require any specific permissions and triggers as its only for demonstration, but if your lambda function has any specific permissions and triggers or any other thing, please note it down, as you may want to add it to the duplicate function as well. Step 5: Download the Code After noting down all the important configurations, download the function code. Scroll up and you will see a download option in the top-right corner of the Function Overview Box. Click on the Download button and select Download function code .zip file. ![]() After successfully downloading the function code, we are ready to duplicate this function. Step 6: Create a new Lambda Function Go to the Lambda home page and select the Create Function Button. ![]() Step 7: Select Runtime and Architecture Once inside the create function page, give your duplicate function any name. Give it the same runtime and architecture which you noted down earlier. For me it was Python 3.12 and x86_64 architecture. Select the Create Function button. ![]() Step 8: Configure the new function
Step 9: Upload the .zip file After successfully completing the above steps, upload the .zip file downloaded previously into the new Lambda function’s code. Inside the code tab of the lambda function, Select the Upload button from the top right corner and then select .zip file Upload the downloaded file into your new lambda function ![]() Step 10: Test your new function. Test your duplicate lambda function if its working as expected or not. If not, check the configuration settings again and correct if any mistake is present. ConclusionThere is no specific one click button to duplicate a lambda function but it can be duplicated if one follows the some series of steps properly. Duplicating a lambda function may provide several benefits such as Testing new features, Backup and Recovery, Simplified Management, etc. Duplicate an AWS Lambda Function – FAQsWhy to Duplicate a lambda function?
Can the function be duplicated using AWS CLI
How can I ensure that the new function has the same permissions as the original?
|
Reffered: https://www.geeksforgeeks.org
Amazon Web Services |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 16 |