Exams / DVA-C02 / Versions, aliases and stages / Question 2
DVA-C02 practice question: Versions, aliases and stages (2 of 3)
Deployment A free question from our original DVA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A prod alias points to version 5 of a Lambda function. The developer must change one environment variable for production, but the console does not allow editing the configuration of version 5. What is the correct way to make the change?
Choose one answer.
- AA. Update the environment variable on $LATEST, publish a new version and point the prod alias to it.
- BB. Use the CLI to update the configuration of version 5 by passing the version as a qualifier.
- CC. Set the environment variable on the prod alias so it overrides the version's value.
- DD. Delete version 5 and publish the function again so that version 5 gets the new value.
Show the answer and explanation
Answer: A
- A. Right: Correct. Published versions are immutable snapshots, so changes go into $LATEST and become a new version.
- B. Wrong: Code and most configuration of a published version, including environment variables, cannot be changed by any tool.
- C. Wrong: Aliases are pointers to versions. They have no environment variables of their own.
- D. Wrong: Deleting a version breaks the alias, and publishing creates a new version number rather than reusing the old one.
Explanation
Publishing a Lambda version creates an immutable snapshot of its code and most of its configuration, including environment variables. To change any of these, update the unpublished $LATEST, publish a new version and move the alias. Clients that call the alias need no change.
Study
Keep practising
Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.