AWS Certified Developer – Associate (DVA-C02) — Question 545

A company’s developer needs to activate Amazon CloudWatch Logs Insights for an application’s AWS Lambda functions. The company uses an AWS Serverless Application Model (AWS SAM) template to deploy the application. The SAM template includes a logical resource that is named CloudWatchLogGroup.

How should the developer modify the SAM template to activate CloudWatch Logs Insights for the Lambda functions?

Answer options

Correct answer: C

Explanation

To enable CloudWatch Lambda Insights for AWS Lambda functions, the Lambda Insights extension must be added as a layer to the functions, and the execution role must have the CloudWatchLambdaInsightsExecutionRolePolicy AWS managed policy attached. Modifying log group outputs or parameters (Options A and B) does not activate the monitoring extension. Enabling active tracing (Option D) is used for AWS X-Ray, not CloudWatch Lambda Insights.