AWS Certified Developer - Associate (DVA-C03) free question 1 / 10 · Domain 1: Development with AWS Services
A developer published version 3 of a Lambda function. Load tests show that version 3 needs more memory, and the developer wants to raise the memory setting of that version only. What does Lambda allow?
- Delete version 3 and publish the changed function under the same version number
- Edit $LATEST and publish a new version, because a published version's memory is immutable
- Call the update-function-configuration operation on version 3 to raise its memory in place
- Deploy the new code and settings to $LATEST, which updates the published versions at the same time
Show the answer and explanation
Answer: B
Why this is correct
Each time you publish, Lambda creates a version that is a copy of the unpublished $LATEST. After that, the version's code, runtime, architecture, memory, layers and most other configuration settings are immutable. The only way to change them is to edit $LATEST and publish a new version from it. A published version still allows some items to change: triggers, destinations, provisioned concurrency, asynchronous invocation settings and database connections and proxies.
Why the other options are wrong
"Call the update-function-configuration operation on version 3 to raise its memory in place" … After a version is published, its code, runtime, architecture, memory, layers and most other settings are immutable. Settings can only be changed by publishing a new version from $LATEST.
"Deploy the new code and settings to $LATEST, which updates the published versions at the same time" … Deploying code overwrites the code in $LATEST only. Published versions keep their own copy and stay the same, which is why they can be used for stable releases.
"Delete version 3 and publish the changed function under the same version number" … Lambda creates a new version each time you publish, and each is a separate copy. A version number is not reused for changed content, so the developer ends up with a new version number.
Key points
Published versions are immutable for code, runtime, memory and layers. Triggers, destinations, provisioned concurrency and async settings can still be configured per version.