Course menuDVA-C03

Exams / DVA-C03 / Versions, aliases and stages / Question 2

DVA-C03 practice question: Versions, aliases and stages (2 of 3)

Testing and Deployment A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A Lambda function has published versions 4 and 5.

The prod alias points to version 5. Shortly after version 5 was released, customers began to see errors from one code path. The team must restore the previous behavior within minutes, without changing any client, and the fix must not depend on code that has not been tested.

What should the developer do?

Choose one answer.

  1. A. Update the code in $LATEST to match version 4, publish a new version, and point the prod alias at it.
  2. B. Point the prod alias back at version 4, which is still published and unchanged.
  3. C. Delete version 5 so that the prod alias falls back to version 4 automatically.
  4. D. Set an environment variable on the prod alias that switches the failing code path off.
Show the answer and explanation

Answer: B

  • A. Wrong: Publishing from $LATEST creates a new build from code that may not match version 4 and has not been tested. It takes more steps than moving the alias, and it does not meet the rule against untested code.
  • B. Right: Correct. Published versions are fixed snapshots, so version 4 is unchanged. Moving the alias restores the previous code straight away, and clients keep calling the same alias. Learn more: Using Lambda aliases in event sources and permissions policies (opens in a new tab)
  • C. Wrong: Deleting a version does not move an alias. Prod would still need its alias changed, and the failing code would be removed without any way to compare it with the fix.
  • D. Wrong: Aliases hold no environment variables. Only a function version or $LATEST has its own configuration, and the failing code would stay live.

Explanation

Each published version of a Lambda function is a fixed snapshot, and an alias is only a pointer to one version. Moving prod back to version 4 is a rollback that needs no code change, and clients keep calling the alias. Deleting versions or using environment variables on an alias does not do this.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Versions, aliases and stages? The 5 full-length practice sets have 14 more Versions, aliases and stages questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets