SAP-C02 practice question 27 of 35

A company hosts a Git repository in an on-premises data center. The company uses webhooks to invoke functionality that runs in the AWS Cloud. The…

Full set: 689 questions

Domain Accelerate Workload Migration and Modernization

A company hosts a Git repository in an on-premises data center. The company uses webhooks to invoke functionality that runs in the AWS Cloud. The company hosts the webhook logic on a set of Amazon EC2 instances in an Auto Scaling group that the company set as a target for an Application Load Balancer (ALB). The Git server calls the ALB for the configured webhooks. The company wants to move the solution to a serverless architecture. Which solution will meet these requirements with the LEAST operational overhead?
Answer options
A: For each webhook, create and configure an AWS Lambda function URL. Update the Git servers to call the individual Lambda function URLs.
B: Create an Amazon API Gateway HTTP API. Implement each webhook logic in a separate AWS Lambda function. Update the Git servers to call the API Gateway endpoint. Correct answer
C: Deploy the webhook logic to AWS App Runner. Create an ALB, and set App Runner as the target. Update the Git servers to call the ALB endpoint.
D: Containerize the webhook logic. Create an Amazon Elastic Container Service (Amazon ECS) cluster, and run the webhook logic in AWS Fargate. Create an Amazon API Gateway REST API, and set Fargate as the target. Update the Git servers to call the API Gateway endpoint.
Correct Answer:
B. Create an Amazon API Gateway HTTP API. Implement each webhook logic in a separate AWS Lambda function. Update the Git servers to call the API Gateway endpoint.
Explanation

The goal is to replace an EC2-based webhook handler with a serverless solution that minimizes operational overhead. An Amazon API Gateway HTTP API integrated with AWS Lambda functions is the ideal serverless pattern for this use case. API Gateway provides a managed, scalable, and secure entry point (a single endpoint) for the HTTP-based webhooks. It can then route requests to the appropriate backend Lambda function, which contains the business logic. This architecture is fully serverless, eliminating the need to manage servers, load balancers, or scaling policies, thereby meeting the requirement for the least operational overhead.

Why Incorrect

A. While Lambda function URLs are serverless, this approach would require managing a separate URL for each webhook on the Git server, increasing configuration complexity compared to a single, centralized API Gateway endpoint.
C. This option is not fully serverless as it re-introduces an Application Load Balancer (ALB). AWS App Runner provides its own managed endpoint, making the addition of an ALB redundant and increasing operational overhead.
D. While AWS Fargate is a serverless compute engine, it requires managing container images, task definitions, and service configurations. This introduces more operational overhead than simply deploying code to AWS Lambda.

References

1. AWS Documentation - Choosing between Lambda function URLs and Amazon API Gateway: "API Gateway is a fully managed service that makes it easy for you to create

publish

maintain

monitor

and secure APIs at any scale... If you’re building an API that requires the capabilities of API Gateway

such as request validation

throttling

custom authorizers

custom domains

usage plans

or caching

we recommend that you use API Gateway." This supports using API Gateway for a robust webhook system.

Source: AWS Lambda Developer Guide

"Invoking Lambda function URLs".

2. AWS Documentation - What Is Amazon API Gateway?: "Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls

including traffic management

CORS support

authorization and access control

throttling

monitoring

and API version management." This highlights the low operational overhead of using API Gateway as the front door.

Source: Amazon API Gateway Developer Guide

"What Is Amazon API Gateway?".

3. AWS Documentation - Tutorial: Create an HTTP API with a Lambda proxy integration: This official tutorial demonstrates the exact pattern described in the correct answer (B)

establishing it as a standard

low-overhead serverless architecture for handling HTTP requests.

Source: Amazon API Gateway Developer Guide

"Tutorial: Create an HTTP API with a Lambda proxy integration".

Scroll to Top