I have an AWS Lambda function that is triggered from an API Gateway API. I want to duplicate this Lambda function including the triggers. How can I do this? I tried using "create version" but the API Gateway trigger is not duplicating and I am not able to change the code.
Fortunately, you can assign lambda expressions to variables and reuse them, as you would with objects.
Navigate over to your lambda function settings and on the top right you will have a button called " Actions ". In the drop down menu select " export " and in the popup click "Download deployment package" and the function will download in a . zip file. Click on the function.
On the Create component page, under Component information, choose Import Lambda function. In Lambda function, search for and choose the Lambda function that you want to import. AWS IoT Greengrass creates the component with the name of the Lambda function. In Lambda function version, choose the version to import.
When editing a lambda function, you can go Actions > Export Function > Download deployment package.
This downloads a .zip file of the function.
Then create a new Lambda, and go "Upload from" (right above the code editor) > ".zip file"
This duplicates the code and npm modules etc... Not the triggers or permissions of the function though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With