How to Mock API Gateway Responses Without a Backend?
Short answer
A Create API Gateway resources and set the integration type value to MOCK. Configure the method integration request and integration response to associate a response with an HTTP status code. Create an API Gateway stage and deploy the API.
Question
Key Takeaways
This question tests knowledge of API Gateway's MOCK integration type, which returns a predefined response without invoking any backend service — a common trap is over-engineering the solution with Lambda or EC2 when a simple MOCK integration suffices.
When developing APIs in parallel, Amazon API Gateway MOCK integration allows teams to simulate backend responses without a real backend. This enables dependent teams to continue development and testing before the actual backend is ready.
Common mistake: Candidates often choose Option B (Lambda with AWS_PROXY) because it seems like a flexible way to return mock responses, but it requires creating and maintaining a Lambda function, which is unnecessary overhead when API Gateway natively supports MOCK integration.
Expert Analysis
Understanding the Requirement
The scenario describes a parallel development workflow where frontend or dependent teams need to consume an API before the backend is fully built. The key requirement is to publish an API without an integrated backend so that other teams can continue their work.
Why Option A is Correct
MOCK integration in Amazon API Gateway is specifically designed for this use case. When you set the integration type to MOCK, API Gateway returns a response without invoking any backend service. You configure:
- Integration Request: Define the response payload and HTTP status code using mapping templates.
- Integration Response: Map the mock response to the method response.
- Deploy the API to a stage so it becomes accessible.
Why the Other Options Are Wrong
- Option B (Lambda + AWS_PROXY): While functional, this introduces unnecessary complexity. You must write, deploy, and maintain a Lambda function just to return static mock data. MOCK integration does this natively.
- Option C (EC2 + AWS integration): This is the most expensive and complex solution. Provisioning EC2 instances just for mock responses is a significant over-engineering mistake.
- Option D (HTTP_PROXY + Lambda Layer): HTTP_PROXY forwards requests to an HTTP backend, which contradicts the "no backend" requirement. Additionally, Lambda layers are for sharing code/libraries between Lambda functions — they cannot return HTTP responses on their own. This option is technically nonsensical.
Community Consensus
The community overwhelmingly agrees with Option A (100% vote). Commenters confirm that MOCK integration is the standard approach for simulating API responses without a real backend, enabling parallel development workflows.
Official Reference
https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-mock.html
This link opens the official vendor documentation in a new tab.
Exam Strategy
When you see keywords like 'mock,' 'simulate,' or 'without a backend' in API Gateway questions, immediately think of MOCK integration. Avoid over-engineering with Lambda or EC2 unless the question explicitly requires dynamic logic or external processing.
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 3 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 3
-
ANDRES715 👍 3 Answered AAl crear recursos de API Gateway y establecer el tipo de integración en MOCK, se puede simular la respuesta de la API sin necesidad de un backend real. Esto permite que los equipos de desarrollo trabajen en paralelo en componentes separados de la aplicación y continúen el trabajo de desarrollo antes de que se complete el backend de la API.
-
CrescentShared 👍 4 Answered ADuplicated question.
-
65703c1 👍 2 Answered AA is the correct answer.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →