How to Test Updated Lambda Functions with a Subset of Users Using API Gateway?

A company has a mobile app. The app includes an Amazon API Gateway REST API that invokes AWS Lambda functions. The Lambda functions process data from the app. The company needs to test updated Lambda functions that have new features. The company must conduct these tests with a subset of users before deployment. The tests must not affect other users of the app. Which solution will meet these requirements with the LEAST amount of operational effort?

  1. Create a new version of each Lambda function with a weighted alias. Configure a weight value for each version of the Lambda function. Update the new weighted alias Amazon Resource Name (ARN) in the REST API. Source Reference Answer
  2. Create a new REST API in API Gateway. Set up a Lambda proxy integration to connect to multiple Lambda functions. Enable canary settings on the deployment stage. Specify a smaller percentage of API traffic to go to the new version of the Lambda function.
  3. Create a new version of each Lambda function. Integrate a predefined canary deployment in AWS CodeDeploy to slowly shift the traffic to the new versions automatically.
  4. Create a new REST API in API Gateway. Set up a Lambda non-proxy integration to connect to multiple Lambda functions. Specify the necessary parameters and properties in API Gateway. Enable canary settings on the deployment stage. Specify a smaller percentage of API traffic to go to the new version of the Lambda function.

Community Votes

A
51%
B
49%

51% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

The question evaluates understanding of Lambda versioning and weighted aliases for traffic shifting, highlighting the trap of over-engineering with new APIs or CodeDeploy when a simple alias update suffices.

This question tests the most efficient way to perform canary testing of updated AWS Lambda functions behind an Amazon API Gateway REST API using weighted aliases, minimizing operational overhead while isolating a subset of users.

Many candidates choose Option B, assuming API Gateway canary settings require less effort, but creating a new REST API and configuring proxy integrations for multiple Lambda functions adds unnecessary complexity and operational overhead.

Community Discussion (19 comments)

DeaconStJohn 👍 9 Selected: A
The wording is screaming out weighted alias. During a canary deployment, we are moving code from testing to prod. We can define a subset of users i.e. 10% for a set period of time. After this the other users will be impacted as the percentage will increment or the deployment will push new code to 100% of users. With a weighted alias we can define a subset of users and use this as our guinea pigs to test new code. As this isn't a canary deployment we have no risk of more users becoming impacted. Operational overhead is minimal as we only need to point to a new alias. With weighted alias we can deploy for testing purposes. From my understanding lambda proxy is grouping lambda functions. the traffic splitting would need to be set at the lambda level as this is testing prior to deployment.
ethanluvsbooks 👍 5 Selected: B
This is the least amount of effort. I originally thought answer A but then you will have more effort because will have to update API Gateway configuration to use new ARN etc. Unless there are other thoughts on this?
Shamalka 👍 1 Selected: A
The simple answer is A. The Simple reason for the answer to not be D is why you would need to create a new Rest API endpoint.?
examuserss 👍 1 Selected: A
Best Solution: Option A: Create a new version of each Lambda function with a weighted alias. Configure a weight value for each version of the Lambda function. Update the new weighted alias Amazon Resource Name (ARN) in the REST API. This is the least complex and most efficient solution. By using weighted aliases for Lambda versions, you can control the traffic sent to the new version of the function, and it can be done with minimal operational overhead, without the need to create a new API or involve other services like AWS CodeDeploy.
ShakthiGCP 👍 1 Selected: A
Weight ed alias
ShakthiGCP 👍 1 Selected: A
Yes. Answer is Option A. B will eventually push all users to new alias as part of canary deployment.
Saudis 👍 1 Selected: B
B provides the least operational effort
abdulla203 👍 1 Selected: A
I think A is direct
wh1t4k3r 👍 2
I am going with A, not sure if creating a new rest api is less effort then just managing the existing API config for the weight.
tomchandler077 👍 1
Option A is typically the most straightforward and requires the least operational effort while providing high control over traffic distribution directly from the Lambda configuration. This method avoids the overhead of managing additional services or creating new APIs and is directly supported by AWS services for testing purposes with actual users.
65703c1 👍 1 Selected: A
A is the correct answer.
a1971h 👍 3 Selected: B
It says: with the LEAST amount of operational effort B --- NEVER A!!!
yingying920928 👍 4 Selected: A
Prefer A, because creating a new REST API (B) involves more operational overhead and complexity compared to using weighted aliases. Moreover, setting up a Lambda proxy integration to connect to multiple Lambda functions can increase complexity, especially when handling different versions for canary testing.
KarBiswa 👍 3 Selected: B
https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html
ANDRES715 👍 1 Selected: D
} El desarrollador debe crear una nueva API REST en Amazon API Gateway y configurar una integración Lambda sin proxy para conectarse a múltiples funciones Lambda. Luego, debe especificar los parámetros y propiedades necesarios en API Gateway y habilitar la configuración canary en la etapa de implementación. Especifique un porcentaje menor de tráfico API para ir a la nueva versión de la función Lambda. Al utilizar una nueva API REST en API Gateway con una configuración canary, el desarrollador puede probar las funciones Lambda actualizadas con nuevas características con un subconjunto de usuarios antes de la implementación completa. Esto permite realizar pruebas sin afectar a otros usuarios de la aplicación y con un menor esfuerzo operativo.
monishvster 👍 5 Selected: B
Should be B
CrescentShared 👍 5 Selected: B
Option A involves using weighted aliases for Lambda functions, which is a valid approach but requires more effort to manage and update the aliases in the API Gateway configuration.
tgv 👍 4 Selected: A
Lambda with weighted alias with weight configured for each version of the function. The canary situation is much suitable for deployments.
Americo32 👍 2
Opção A

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 requires testing updated Lambda functions with a subset of users before full deployment, ensuring no impact on other users, and achieving this with the LEAST operational effort. This is a classic canary deployment or traffic shifting use case.

Why Option A is Correct

Option A leverages Lambda weighted aliases, a native feature designed precisely for this purpose:

  • Create a new version of the Lambda function.
  • Assign a weighted alias pointing to both the old and new versions with specified traffic percentages (e.g., 90% to old, 10% to new).
  • Update the API Gateway integration to use the alias ARN instead of the function name or version ARN.
This approach is simple, direct, and requires minimal configuration changes. It allows precise control over traffic distribution without duplicating infrastructure or introducing additional services.

Why Other Options Are Incorrect

  • Option B: Suggests creating a new REST API and using canary settings on the deployment stage. While API Gateway does support canary deployments, creating an entirely new API introduces significant operational overhead—duplicating resources, managing separate endpoints, and coordinating deployments. This contradicts the "LEAST operational effort" requirement.
  • Option C: Proposes using AWS CodeDeploy for automated canary deployments. While CodeDeploy is powerful for EC2 or ECS deployments, using it for Lambda functions behind API Gateway adds unnecessary complexity. CodeDeploy is better suited for infrastructure-level deployments, not API traffic shifting.
  • Option D: Similar to Option B but with non-proxy integration, which requires manual mapping of request/response parameters. This is even more complex than proxy integration and definitely not the least-effort solution.

Community Consensus

The community is split (50% A, 48% B), with many candidates initially attracted to Option B due to the phrase "LEAST operational effort." However, as noted by multiple commenters, creating a new REST API (Options B and D) inherently involves more work than simply updating an alias ARN in the existing API configuration. Option A is the most straightforward and aligns with AWS best practices for Lambda traffic shifting.

Official Reference

Exam Strategy

When a question emphasizes 'LEAST operational effort,' avoid solutions that require creating new infrastructure (e.g., new APIs, new services). Look for native, lightweight features like weighted aliases that achieve the goal with minimal configuration changes.

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