Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.3.1. Analyzing Resource Configuration and Permissions

First Principle: Most logging failures are caused by one of three things: missing IAM permissions, incorrect resource configuration, or disabled features. Systematic diagnosis starts by checking these three areas in order.

Common Logging Failures by Service:
ServiceCommon FailureRoot CauseFix
Lambda → CloudWatchNo logs appearExecution role lacks logs:CreateLogGroup, logs:PutLogEventsAdd CloudWatch Logs permissions to execution role
API GatewayNo access/execution logsLogging not enabled in stage settings, or IAM role missingEnable logging in stage, create API Gateway logging role
CloudFrontNo access logsAccess logging disabled, or S3 bucket ACL doesn't grant CloudFront writeEnable logging, fix S3 bucket ACL
Health checksFalse positivesSecurity group blocking health check trafficAllow health check source IPs in security group
CloudTrailMissing data eventsData events not enabled for the specific serviceEnable data events in Trail configuration
Systematic Troubleshooting Process:
  1. Verify the feature is enabled — Is logging turned on for the service?
  2. Check IAM permissions — Does the service role have write access to the log destination?
  3. Check the destination — Is the S3 bucket/CloudWatch log group accessible? Any resource policies blocking access?
  4. Check network path — Can the resource reach the logging endpoint? (VPC endpoints may be needed for private subnets)
  5. Check for encryption conflicts — If the destination uses KMS, does the source service have kms:GenerateDataKey permission?

⚠️ Exam Trap: A VPC-attached Lambda function does NOT need a NAT gateway or VPC endpoint for its own logs — Lambda captures stdout/stderr and delivers it to CloudWatch Logs through the Lambda service, outside your VPC. If a function runs and returns results but no logs appear, check the execution role's logs:CreateLogGroup, logs:CreateLogStream and logs:PutLogEvents permissions first. Network routes (a NAT gateway or a logs interface endpoint) matter when something inside the VPC calls the CloudWatch Logs API itself — the CloudWatch agent on an EC2 instance in a private subnet, or an SDK call from your code.

Scenario: API Gateway access logs stopped appearing in CloudWatch 3 weeks ago. After investigation, you discover that someone rotated the API Gateway's logging IAM role, and the new role doesn't have logs:PutLogEvents permission.

Reflection Question: Why is IAM permission the first thing to check when a service stops sending logs, and how do you prevent recurrence?

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications