Skip to Content

Amazon DVA-C02: How to Test Updates to an AWS Lambda Function by Dividing Traffic?

Learn the steps to test updates to an AWS Lambda function by dividing traffic between the original and new versions using aliases and weights.

Table of Contents

Question

A developer uses an AWS Lambda function in an application to edit users’ uploaded photos. The developer needs to update the Lambda function code and needs to test the updates.

For testing, the developer must divide the user traffic between the original version of the Lambda function and the new version of the Lambda function.

Which combination of steps will meet these requirements? (Choose two.)

A. Publish a version of the original Lambda function. Make the necessary changes to the Lambda code. Publish a new version of the Lambda function.
B. Use AWS CodeBuild to detect updates to the Lambda function. Configure CodeBuild to incrementally shift traffic from the original version of the Lambda function to the new version of the Lambda function.
C. Update the original version of the Lambda function to add a function URL. Make the necessary changes to the Lambda code. Publish another function URL for the updated Lambda code.
D. Create an alias that points to the original version of the Lambda function. Configure the alias to be a weighted alias that also includes the new version of the Lambda function. Divide traffic between the two versions.
E. Create an alias that points to the original function URL. Configure the alias to be a weighted alias that also includes the additional function URL. Divide traffic between the two function URLs.

Answer

A. Publish a version of the original Lambda function. Make the necessary changes to the Lambda code. Publish a new version of the Lambda function.
D. Create an alias that points to the original version of the Lambda function. Configure the alias to be a weighted alias that also includes the new version of the Lambda function. Divide traffic between the two versions.

Explanation

To meet the requirements of testing updates to an AWS Lambda function by dividing user traffic between the original and new versions, you should perform the following two steps:

A. Publish a version of the original Lambda function. Make the necessary changes to the Lambda code. Publish a new version of the Lambda function.

Publishing versions of the Lambda function allows you to have distinct instances of the function code that can be referenced and invoked separately. This is necessary for splitting traffic between versions.

D. Create an alias that points to the original version of the Lambda function. Configure the alias to be a weighted alias that also includes the new version of the Lambda function. Divide traffic between the two versions.

After publishing versions, create an alias (e.g. “test”) that initially points to the original version. Then add the new version to the alias and assign weights to each version (e.g. 50% to each). This causes invocations of the “test” alias to be split between the two versions according to the specified weights.

The other options are incorrect because:

  • CodeBuild is for building and testing code, not for traffic shifting
  • Function URLs allow Lambda to be invoked via HTTP(S) but don’t provide traffic splitting
  • Aliases cannot point directly to URLs, only to Lambda function versions

So in summary, publishing distinct versions of the Lambda function and then using a weighted alias to divide traffic between the versions is the correct approach for incremental testing of Lambda function updates.

Amazon AWS Certified Developer – Associate DVA-C02 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Amazon AWS Certified Developer – Associate DVA-C02 exam and earn Amazon AWS Certified Developer – Associate DVA-C02 certification.