A SysOps Administrator is configuring a VPC Flow Log to deliver traffic logs to an Amazon CloudWatch Logs log group. The administrator has created the log group and an IAM role with a trust policy that allows the VPC Flow Logs service principal to assume the role. The IAM role has a permissions policy that allows it to create log streams and put log events. However, when the administrator attempts to create the VPC Flow Log using the AWS CLI, the command fails with an Access Denied error.
Which of the following is the most likely cause of this issue?
- The IAM policy attached to the SysOps Administrator's user account lacks the iam:PassRole permission for the VPC Flow Logs service role.Answer
- BThe CloudWatch Logs log group has an indefinite retention period (Never Expire), which prevents the VPC Flow Logs service from establishing the log delivery stream.
- CThe IAM role's trust policy is missing the sts:AssumeRole action for the SysOps Administrator's user ARN.
- DThe KMS key policy attached to the CloudWatch Logs log group does not permit the SysOps Administrator's IAM user to encrypt log streams.
Answer
The IAM policy attached to the SysOps Administrator's user account lacks the iam:PassRole permission for the VPC Flow Logs service role.
To create a VPC Flow Log that publishes to CloudWatch Logs, you must pass the IAM role that has permissions to write to CloudWatch Logs. AWS requires the user creating the flow log to have the iam:PassRole permission on that role to prevent unauthorized escalation of privileges.
Step-by-Step Solution
Key Concept
VPC Flow Logs IAM Delegation and PassRole Permissions
Estimated Time:1m 30s