DVA-C02 Question 265
Single answerA developer is deploying a new version of an API using Amazon API Gateway. The team wants to enable users to test the new version without affecting the production traffic. Which approach should the developer take to achieve this?
- A
Deploy the new version to a new stage and provide users with the stage-specific endpoint.
- B
Overwrite the existing production stage with the new version and monitor for any issues.
- C
Deploy the new version to an existing stage by updating the stage configuration.
- D
Create a canary deployment within the existing production stage to route a portion of traffic to the new version.
Show answer and explanation
Correct answer: A
Explanation
API Gateway stages allow developers to create and manage multiple environments (e.g., dev, test, prod). Deploying a new version to a separate stage enables testing without interfering with production traffic. This ensures that users can verify the new API version independently before considering it for broader deployment.
- A. Correct.
Correct: Deploying the new version to a new stage allows users to test the updated API independently by using the stage-specific endpoint. This does not affect production traffic.
- B. Incorrect.
Incorrect: Overwriting the production stage will replace the live API with the new version, impacting all users and defeating the purpose of isolated testing.
- C. Incorrect.
Incorrect: Deploying to an existing stage will directly update it, potentially impacting users who rely on the current version of the API.
- D. Incorrect.
Incorrect: While canary deployments are useful for gradual rollouts, they are not suitable for isolated testing since a portion of production traffic would still be routed to the new version.