A developer adds a new resource, /orders/{id}, with a GET method to a REST API in Amazon API Gateway, and saves the change.
The dev stage serves the API, and the existing paths still work. Calls to the new path return Not Found, although the method appears in the API Gateway console.
What should the developer do?
Choose one answer.
AA. Delete the dev stage and create it again, so that it reads the latest version of the API definition.
BB. Create a new deployment of the API, and choose that deployment for the dev stage.
CC. Clear the dev stage's cache, since the cache still holds the old API definition.
DD. Turn on canary release for the dev stage and send 100% of its traffic to the canary.
Show the answer and explanation
Answer: B
A. Wrong: Recreating the stage still points it at a deployment, so the new resource is missing until a deployment is created. It also removes the stage's settings and interrupts callers.
C. Wrong: API Gateway caches responses, not the API definition. Clearing the cache does not add the new resource to the deployed API.
D. Wrong: A canary still serves a deployment, and the new resource must be in a deployment first. Sending all traffic to the canary changes which deployment serves requests, not what that deployment contains.
Explanation
API Gateway serves each stage from a deployment, a snapshot of the API's configuration. Changes to resources and methods require a redeployment before any stage uses them. Clearing caches, recreating the stage or using a canary does not put the new resource into the deployment.
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 →