Q90 — AWS DVA-C02 Ch.1

Question 90 of 100 | ← Chapter 1

A developer deployed an AWS Lambda function that executes each time a new Amazon S3 bucket is created. The Lambda function should attach an S3 Lifecycle policy to each new S3 bucket. The developer found that newly created S3 buckets do not have an S3 Lifecycle policy attached. Which AWS service should the developer use to troubleshoot potential errors in the Lambda function?

Correct Answer: D. Amazon CloudWatch

Explanation

Amazon CloudWatch is a service for monitoring and observing AWS resources. In this scenario, the developer can use CloudWatch to monitor the execution of the Lambda function, including viewing execution logs, metrics, and alarms, thereby identifying potential errors. AWS CloudTrail primarily tracks API calls, Amazon S3 is a storage service, and AWS CloudFormation manages infrastructure-as-code templates. Compared to these, CloudWatch is best suited for troubleshooting errors during Lambda function execution. Therefore, the answer is D.