6

Would someone please clarify what happens when you update a Lambda function? Do you HAVE to "Publish a new version from $LATEST"? Or will the changes be available as soon as you hit Save?

The confirmation message in the Publish dialog sounds like something I don't want to do...

Publishing a new version saves a snapshot of the code and configuration of the $LATEST version. You can't edit the new version's code. Click to confirm.

and I'm being cautious because this is my first serious Lambda.

I have read the AWS page on versioning, but I'm still confused: https://docs.aws.amazon.com/lambda/latest/dg/versioning-intro.html

1 Answer 1

9

Hitting save overwrites $LATEST.

Once you publish a version, a copy of $LATEST is made, and it's assigned a new numeric version identifier. That new numbered version is frozen, immutable, and can't be edited -- but you can still always edit $LATEST.

Invoking the function and specifying that assigned version number (it's on the end of the ARN) will thus always run exactly that same immutable code and associated configuration -- unless you subsequently delete the version.

This is just an informational message. You aren't going to make a mistake by publishing a new version.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks @michael-sqlbot. Okay, so I presume two things: by not specifying the version number it will always invoke the latest published version of the Lambda function. Roger that!
Not the latest published numeric version, if that's what you mean. It should always invoke $LATEST if called unqualified.
Okay. I think this has sunk in. $LATEST is what you have when you hit Save. A numbered version when you Publish. You can specify the version arn if you need to invoke a specific version of the function. Thanks again.
This seems to have changed. Can anyone confirm? I am not able to publish a saved version anymore, and now $LATEST points to the last deployed version, not the last saved version!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.