A developer is editing a Lambda function and wants to use a weighted alias to send a slice of traffic to the brand-new code while most traffic stays on the current stable code. The new code currently exists only as the editable draft. What must the developer do before a weighted alias can split traffic between the two code states?
- AAdd $LATEST as the additional version on the alias with a small weight, because Lambda treats the draft as an implicit version that weighting can address directly.
- BPublish the draft as a numbered version, because a weighted alias can only split traffic between two published versions and cannot route any portion of traffic to $LATEST. Correct
- CCreate a second alias on the draft and weight the first alias against the second one, because weighting is expressed between two aliases rather than between versions.
- DEnable the function's auto-publish setting so every saved draft becomes a version, then weight the alias against the most recent automatic version.
Why A is wrong: Lambda does not let an alias weight traffic to $LATEST at all, so naming the draft as the additional version is rejected and no split between the two code states occurs.
Why B is correct: A weighted alias references a primary published version plus one additional published version, and $LATEST is not a valid weighting target, so the draft must be published before the alias can route to it.
Why C is wrong: Weighting is configured between two published versions inside a single alias, not between two separate aliases, so this misstates the routing model and an alias still cannot point at the draft.
Why D is wrong: There is no auto-publish toggle that snapshots each save, and a version exists only when the developer explicitly publishes one, so this option relies on behaviour Lambda does not offer.