AWS Certified Developer – Associate — Question 405

A developer deploys an AWS Lambda function that runs each time a new Amazon S3 bucket is created. The Lambda function is supposed to attach an S3
Lifecycle policy to each new S3 bucket. The developer discovers that newly created S3 buckets have no S3 Lifecycle policy attached.
Which AWS service should the developer use to find a possible error in the Lambda function?

Answer options

Correct answer: D

Explanation

Amazon CloudWatch is the correct service because AWS Lambda automatically sends execution logs and runtime errors to CloudWatch Logs, making it the primary tool for debugging Lambda code. While AWS CloudTrail records API calls across the AWS infrastructure, it does not capture internal application logs or code-level errors. Amazon S3 and AWS CloudFormation do not provide the execution logs necessary to troubleshoot Lambda function failures.