Which of the following explains why the logs are not available?
The execution role for the Lambda function did not grant permissions to write log data to CloudWatch Logs.
The Lambda function was executed by using Amazon API Gateway, so the logs are not stored in CloudWatch Logs.
The execution role for the Lambda function did not grant permissions to write to the Amazon S3 bucket where CloudWatch Logs stores the logs.
The version of the Lambda function that was executed was not current.
Explanations:
The execution role for the Lambda function must have the necessary permissions to write logs to CloudWatch Logs. If it does not, no log data will be recorded, resulting in missing logs.
Logs from a Lambda function executed via Amazon API Gateway can still be found in CloudWatch Logs, provided that the function has the appropriate logging permissions. API Gateway has its own logging capabilities, but it does not prevent Lambda from writing logs to CloudWatch.
CloudWatch Logs does not use Amazon S3 to store logs. It stores logs directly within the CloudWatch service. Therefore, a lack of permissions to write to an S3 bucket would not impact the availability of Lambda logs in CloudWatch.
The version of the Lambda function being executed does not affect whether logs are generated or stored in CloudWatch. As long as the Lambda function is invoked, it should log data if configured correctly, regardless of the version.