Interview Prep/AWS/VPC and Networking

What is a VPC flow log and how would you use it when a connection is mysteriously dropped?

BeginnerScenarioVPC and Networking
Answer

Situation read → Flow logs record accepted and rejected flows per ENI, subnet or VPC.

What I'd do →

  1. Enable: aws ec2 create-flow-logs --resource-type VPC --resource-ids vpc-0abc --traffic-type ALL --log-destination-type s3 --log-destination arn:aws:s3:::flowlogs-bucket
  2. Query with Athena for action = 'REJECT' on the destination IP and port
  3. Distinguish SG vs NACL: stateless NACL rejects often show up on return traffic
  4. Fix the rule that shows the REJECT

Why → Flow logs show whether traffic reached the ENI and was refused, narrowing blame to the network.

Interview tip → Flow logs exclude DNS to Route 53 resolver and IMDS traffic.

aws All AWS questions Roadmap: AWS core services

More on VPC and Networking