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?

  1. 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. Source Reference Answer
  2. Create an AWS Lambda function that returns mocked responses and various HTTP status codes. Create API Gateway resources and set the integration type value to AWS_PROXY. Deploy the API.
  3. Create an EC2 application that returns mocked HTTP responses. Create API Gateway resources and set the integration type value to AWS. Create an API Gateway stage and deploy the API.
  4. Create API Gateway resources and set the integration type value set to HTTP_PROXY. Add mapping templates and deploy the API. Create an AWS Lambda layer that returns various HTTP status codes. Associate the Lambda layer with the API deployment.

Community Votes

A
100%

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)

65703c1 👍 2 Selected: A
A is the correct answer.
ANDRES715 👍 3 Selected: A
Al 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 Selected: A
Duplicated question.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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.
This is the simplest, most cost-effective, and AWS-recommended approach for mocking API responses during development.

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 →

← Back to DVA-C02 Study Guide