A SysOps Administrator is configuring VPC Flow Logs to capture traffic from a critical production subnet and deliver the logs to an Amazon CloudWatch Logs log group. After creating the flow log, the administrator notices that the log group remains empty and no log streams are generated. The administrator verifies that the flow log status is active but no logs are being delivered.
Which of the following configuration issues are likely causing this problem? (Select TWO.)
- The trust policy of the IAM role assigned to the flow log does not list the vpc-flow-logs.amazonaws.com service principal as a trusted entity.Answer
- The IAM policy attached to the flow log's IAM role does not grant the logs:CreateLogStream and logs:PutLogEvents permissions for the destination log group.Answer
- CThe target CloudWatch Logs log group has its retention period set to 'Never expire', which prevents new log streams from initializing.
- DThe trust policy of the IAM role is configured with the iam:PassRole action instead of the sts:AssumeRole action to allow the service to assume the role.
- EThe subnets associated with the monitored resources do not have a route to the CloudWatch Logs interface VPC endpoint in their route tables.
Answer
The correct answers are that the IAM role's trust policy must trust the vpc-flow-logs.amazonaws.com service principal, and the policy attached to the role must grant the logs:CreateLogStream and logs:PutLogEvents permissions.
To successfully publish VPC Flow Logs to CloudWatch Logs, the flow log service requires an IAM role. The trust policy of this IAM role must allow the vpc-flow-logs.amazonaws.com service principal to perform the sts:AssumeRole action. Additionally, the permissions policy attached to the role must grant logs:CreateLogStream and logs:PutLogEvents permissions for the target CloudWatch Logs log group. If either of these is missing, VPC Flow Logs will be unable to deliver logs even if the flow log status is active.
Step-by-Step Solution
Key Concept
VPC Flow Logs requires an IAM role with a trust policy allowing the vpc-flow-logs.amazonaws.com service principal to assume the role, and an attached policy allowing logs:CreateLogStream and logs:PutLogEvents.
Estimated Time:2m 0s