DVA-C02 Question 255
Select 3You have a Lambda function that is actively in use and needs updates. To ensure that the changes do not disrupt the existing users, you decide to use Lambda versions and aliases. Which of the following statements are true about using Lambda versions and aliases in this scenario?
- A
A Lambda version is immutable once it is published.
- B
An alias can point to a specific Lambda version or the $LATEST version directly.
- C
Aliases can be used to perform traffic shifting between two Lambda versions for gradual updates.
- D
A new Lambda version is automatically published whenever you update the function code.
- E
Aliases provide a layer of indirection, allowing you to update code without changing the client invocation.
Show answer and explanation
Correct answers: A, C, E
Explanation
Using Lambda versions and aliases is a powerful way to manage updates without disrupting existing users. Versions are immutable snapshots of your code and configuration, while aliases provide a pointer to specific versions. Aliases can also enable traffic shifting, making them ideal for gradual deployments or testing. This ensures flexibility and stability during updates.
- A. Correct.
Correct. Lambda versions are immutable once published, meaning the code cannot be modified after a version is created.
- B. Incorrect.
Incorrect. An alias cannot directly point to the $LATEST version. It must point to a specific version.
- C. Correct.
Correct. Aliases can perform traffic shifting between two versions, enabling gradual rollouts and canary deployments.
- D. Incorrect.
Incorrect. A new Lambda version is not automatically published when updating the function code. You must explicitly publish a version.
- E. Correct.
Correct. Aliases provide a way to abstract version numbers, allowing clients to invoke the alias and making it easier to update the Lambda function behind the scenes.