A web application uses API Gateway with a Lambda backend. A developer fixed a bug in the Lambda code and must validate the fix in a new development environment before promoting it to production. There is only a production stage available, and the developer must prevent other developers from overwriting the test changes. Which combination of steps achieves this with the least effort? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Change the Lambda function in the API Gateway integration to use the hotfix alias. Deploy the API to a new stage named hotfix and test the backend., Fix the Lambda code and test it. When it works, publish a new Lambda version. Create an alias named hotfix and point that alias to the new published version..
Why this is the answer
The correct options leverage Lambda versions and aliases, which are designed for safe code deployments and testing. Publishing a new Lambda version and creating an alias (hotfix) pointing to it (second correct option) allows for independent testing of the bug fix without affecting the $LATEST or production versions. Then, changing the API Gateway integration to use this hotfix alias and deploying to a new hotfix stage (first correct option) isolates the testing environment. This prevents other developers from overwriting the test changes because the hotfix stage and its associated Lambda alias are distinct from the production setup. Incorrect options: Creating a new resource in the production stage is not ideal because it mixes development changes with production, increasing the risk of unintended impact. Creating an alias pointing to $LATEST is problematic as $LATEST is mutable and can be overwritten by other developers, defeating the purpose of isolating changes. Creating a separate API Gateway API is unnecessary effort for a simple bug fix and introduces management overhead. Lambda versions and aliases, combined with API Gateway stages, provide a more streamlined solution.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed