DVA-C02 Question 266
Single answerYou are developing a REST API using Amazon API Gateway. Your team has created multiple stages to manage different environments: 'dev', 'test', and 'prod'. You have deployed the latest API changes to the 'dev' stage and now need to roll them out to the 'test' stage. What is the correct way to achieve this?
- A
Deploy the API to the 'test' stage using the API Gateway console or CLI.
- B
Clone the 'dev' stage and rename it to 'test'.
- C
Update the 'test' stage to point to the same deployment as 'dev'.
- D
Manually copy the API configuration from the 'dev' stage to the 'test' stage.
Show answer and explanation
Correct answer: A
Explanation
In API Gateway, each stage represents a specific environment (e.g., 'dev', 'test', 'prod') and is associated with a deployment. To roll out changes to another stage, you must explicitly deploy the changes to that stage. This ensures that each stage is independently managed and can have its own configuration, such as stage variables and logging settings.
- A. Correct.
Correct. To deploy changes to the 'test' stage, you need to explicitly deploy the API to the 'test' stage using the API Gateway console, AWS CLI, or SDKs.
- B. Incorrect.
Incorrect. Stages in API Gateway cannot be cloned and renamed. Each stage is created and managed independently.
- C. Incorrect.
Incorrect. Stages cannot directly point to another stage. Instead, each stage references a specific deployment.
- D. Incorrect.
Incorrect. Manually copying the API configuration is not a valid or efficient approach within API Gateway. Deployment is managed through the console, CLI, or SDKs.