DVA-C02 Question 267
Single answerYou are developing a serverless application using AWS API Gateway and Lambda. You want to create separate environments for development, staging, and production using API Gateway stages. Which of the following statements about API Gateway stages is correct?
- A
Each stage is associated with a unique URL that includes the stage name.
- B
You can deploy different versions of the same API to a single stage.
- C
Stage variables can only be configured for the production stage.
- D
Stages are automatically created for every version of your API.
Show answer and explanation
Correct answer: A
Explanation
API Gateway stages are used to manage different environments for an API, such as development, staging, and production. Each stage is assigned a unique URL, which includes the stage name, allowing you to route traffic to a specific environment. This helps you maintain and test different versions of your API independently.
- A. Correct.
Correct. Each stage in API Gateway is assigned a unique URL that includes the stage name, enabling developers to route traffic to specific environments like dev, staging, or production.
- B. Incorrect.
Incorrect. A single stage in API Gateway corresponds to a specific deployment of your API, so you cannot deploy multiple versions to the same stage.
- C. Incorrect.
Incorrect. Stage variables can be configured for any stage, not just production, and are useful for environment-specific configurations.
- D. Incorrect.
Incorrect. Stages are not created automatically; they must be manually defined and associated with a deployment in API Gateway.