AWS Certified Developer – Associate (DVA-C02)Development with AWS ServicesEasy

A developer needs to implement a highly available and scalable backend for a web application using serverless technologies. The application will receive HTTP requests, process them using a Lambda function, and store data in a NoSQL database. The solution must handle unpredictable traffic spikes without manual intervention. Which architecture component should be used to expose the Lambda function as an HTTP endpoint?

  1. AAn AWS Direct Connect link to an on-premises web server.
  2. BAmazon API Gateway.
  3. CAn Amazon EC2 instance running Nginx as a reverse proxy.
  4. DAn Application Load Balancer (ALB) with a Lambda target group.
Show answer & explanation

Correct answer: B. Amazon API Gateway.

Amazon API Gateway is the native serverless service designed to create, publish, maintain, monitor, and secure REST, HTTP, and WebSocket APIs at any scale, making it the ideal choice to expose a Lambda function as an HTTP endpoint for a web application.

Why the other options are wrong

  • A. Direct Connect is for private network connectivity to AWS, not for exposing HTTP endpoints to the internet for a web application.
  • C. Using an EC2 instance defeats the purpose of a serverless architecture and introduces operational overhead.
  • D. While ALB can invoke Lambda, API Gateway is purpose-built for HTTP APIs, offering features like request/response transformation, authorization, caching, and throttling that are usually required for web applications.

Amazon API Gateway

A fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale.

  • Acts as a 'front door' for applications to access backend services.
  • Supports REST, HTTP, and WebSocket APIs.
  • Integrates natively with AWS Lambda and other AWS services.
  • Handles traffic management, authorization, access control, monitoring, and API version management.

Memory trick: API Gateway is the grand entrance for Lambda's serverless show.

More Development with AWS Services questions