A partner API in Amazon API Gateway is a REST API with two stages, dev and prod, and one integration definition shared by both.
The backing Lambda function has aliases named dev and prod that point to different versions. Each stage must invoke only its own alias, and the team wants to avoid copies of the API definition.
Which TWO steps are required? (Choose two.)
Choose two answers.
AA. Add a resource-based permission on each alias that lets apigateway.amazonaws.com invoke it, using the alias as the qualifier.
BB. Create a separate REST API for each stage, each with its own hard-coded alias and deployment in the integration.
CC. Point every integration at $LATEST, which needs no permission and no stage-specific setup.
DD. Use ${stageVariables.lambdaAlias} as the alias in the function ARN, with lambdaAlias set to dev or prod per stage.
EE. Enable X-Ray tracing on the prod stage so that API Gateway can resolve the alias name.
B. Wrong: This can work, but it breaks the requirement to keep one API definition. Every change must then be made in each copy, which the team wants to avoid.
C. Wrong: $LATEST is the unpublished, editable version, so both stages would run the same changing code. This removes the per-stage aliases that keep dev and prod on separate versions.
E. Wrong: X-Ray tracing records requests for debugging. It does not change which Lambda alias an integration calls, so it is unrelated to alias routing.
Explanation
Stage variables let one REST API definition call a different Lambda function or alias for each stage, but they do not grant permission. Each alias that API Gateway calls needs its own resource-based permission. Copying the API or pointing at $LATEST each breaks one of the stated requirements.
Want more on Testing and test automation? The 5 full-length practice sets have 12 more Testing and test automation questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →