How to Mock API Gateway Responses Without a Backend?
A company is building a new application that runs on AWS and uses Amazon API Gateway to expose APIs. Teams of developers are working on separate components of the application in parallel. The company wants to publish an API without an integrated backend so that teams that depend on the application backend can continue the development work before the API backend development is complete. Which solution will meet these requirements?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
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.
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.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
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
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.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →