DVA-C02 Question 254
Select 2You have developed a Lambda function that processes customer orders. To ensure safe deployments, you use Lambda versions and aliases. You want to gradually roll out a new version of your function (v2) while still keeping the previous version (v1) active for fallback. How can you achieve this using AWS Lambda?
- A
Create an alias pointing to v1, then update the alias to point to v2 when ready.
- B
Use the alias to split traffic between v1 and v2 by assigning weights.
- C
Directly update the Lambda function's default version to v2.
- D
Create separate aliases for v1 and v2, and manually manage traffic at the application level.
- E
Assign 100% traffic to v2 immediately using an alias to ensure proper functionality.
Show answer and explanation
Correct answers: B, D
Explanation
To gradually roll out a new Lambda version while keeping the previous version active, you can use aliases with traffic weights to split traffic between versions (e.g., v1 and v2). Alternatively, separate aliases can be used to manage traffic manually at the application level, though this requires more effort. These approaches ensure a smooth transition and allow for quick rollbacks if needed.
- A. Incorrect.
Incorrect. While you can update the alias to point to v2, this approach does not allow traffic splitting or gradual rollout between versions.
- B. Correct.
Correct. Using an alias, you can assign traffic weights to split requests between different Lambda versions (e.g., 80% to v1 and 20% to v2) for gradual rollouts.
- C. Incorrect.
Incorrect. Directly updating the default version does not take advantage of versions and aliases, and it can lead to downtime or unintended consequences.
- D. Correct.
Correct. By creating separate aliases for v1 and v2, you can manually manage traffic splitting at the application level, though this is less automated than using traffic weights.
- E. Incorrect.
Incorrect. Assigning 100% traffic to v2 immediately does not support gradual rollouts and defeats the purpose of traffic splitting and rollback safety.