skip to Main Content

I’ve overwrote an AWS Lambda by accidented and replaced by uploading a zip file containing code for other Lambda function.

Is there any way to recover the previous code?

Moving forward – what’s the best practice for deploying Lambda functions code?

2

Answers


  1. Chosen as BEST ANSWER

    I manage to recover the fields as I downloaded the code a few days before.

    However, let this be a learning experience for newbies like me - It's not good idea to edit code directly in the AWS Lambda, and if you do, use versioning.


  2. If you have been publishing versions, you can go to the versions tab and select a previous version

    enter image description here

    From within that version, there is an option to download the code

    enter image description here

    As suggested in the comments, use a framework like Serverless (https://www.serverless.com/) to handle your deployments properly, and signup for Github to maintain your source code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search