A SysOps Administrator is setting up VPC Flow Logs to publish network traffic metadata to an Amazon CloudWatch Logs group. After configuring the flow log, the administrator notices that no log streams are being created in the target CloudWatch log group. What is the most likely cause of this issue?
- AThe SysOps Administrator's IAM user policy is missing the iam:PassRole action, which is required in the trust policy of the role being assumed by the VPC Flow Logs service.
- The IAM role associated with the flow log does not have a trust relationship allowing the vpc-flow-logs.amazonaws.com service principal to assume it.Answer
- CThe target CloudWatch Logs group is configured with an active 1-day log retention policy, which blocks new flow logs from being initially written.
- DThe route table for the subnets being monitored is missing a route to an Internet Gateway, which prevents the flow logs from being sent to the CloudWatch service endpoint.
Answer
The IAM role associated with the flow log does not have a trust relationship allowing the vpc-flow-logs.amazonaws.com service principal to assume it.
For VPC Flow Logs to successfully publish to CloudWatch Logs, the service must assume an IAM role. The role must contain a trust policy (trust relationship) that allows the service principal 'vpc-flow-logs.amazonaws.com' to perform the 'sts:AssumeRole' action. Without this trust relationship, delivery fails silently and no log streams are created in the target log group.
Step-by-Step Solution
Key Concept
VPC Flow Logs require an IAM role with a trust policy that allows the vpc-flow-logs.amazonaws.com service principal to assume the role, plus permission to publish logs to Amazon CloudWatch Logs.