maafk
maafk

Reputation: 6876

Can I update $LATEST lambda version to point at an old function version

I have a lambda function that I need to roll back and use a previous version.

The lambda is triggered by an S3 event, where S3 invokes the function ARN without any version or alias qualifier, therefore only uses the $LATEST

Due to IAM constraints in the organization, I'm unable to alter the s3 events to point to a specific Lambda version or alias.

Is there an easy way to update $LATEST to point to a previous version of the function?

Upvotes: 3

Views: 3246

Answers (1)

Jimi
Jimi

Reputation: 1845

I don't think you can "out of the box". What you can do is one of the following:

  • Open the Lambda version you want to restore, copy the code and then paste it in the Lambda console. You can now save the "new" code and it will behave like the "old" version

Or

  • If you are using Git (which I hope you do) you can revert the function repository to an old commit, restoring the project to the version you desire (if you know roughly what is the related commit before publishing)

Upvotes: 2

Related Questions