Manage Lambda function versions
You can use versions to manage the deployment of your functions. For example, you can publish a new version of a
function for beta testing without affecting users of the stable production version. Lambda creates a new version of
your function each time that you publish the function. The new version is a copy of the unpublished version of the
function. The unpublished version is named $LATEST.
Importantly, any time you deploy your function code, you overwrite the current code in $LATEST.
To save the current iteration of $LATEST, create a new function version. If $LATEST
is identical to a previously published version, you won't be able to create a new version until you deploy changes
to $LATEST. These changes can include updating the code, or modifying the function configuration settings.
After you publish a function version, its code, runtime, architecture, memory, layers, and
most other configuration settings are immutable. This means that you can't change these settings
without publishing a new version from $LATEST. You can configure the following items for a
published function version:
Note
When using runtime management controls with Auto mode, the runtime version used by the function version is updated automatically. When using Function update or Manual mode, the runtime version is not updated. For more information, see Understanding how Lambda manages runtime version updates.
Creating function versions
You can change the function code and settings only on the unpublished version of a function. When you publish a version, Lambda locks the code and most of the settings to maintain a consistent experience for users of that version.