What are VPC flow logs and what do they show?
BeginnerProductionVPC & Network Architecture
Answer
Metadata records of IP traffic at ENI, subnet or VPC level: source and destination IP and port, protocol, bytes, packets, action ACCEPT or REJECT, and (in v5) additional fields like pkt-srcaddr, flow-direction and tcp-flags. They show no payload.
We ship them to S3 in Parquet and query with Athena, for example "who is hitting REJECT on port 22".
SELECT srcaddr, count(*) c FROM vpc_flow_logs
WHERE action='REJECT' AND dstport=22 GROUP BY srcaddr ORDER BY c DESC LIMIT 20;
More on VPC & Network Architecture
How would you design a production VPC for a three-tier web application?IntermediateHow many AZs and subnets should a production VPC use, and why?BeginnerWhat makes a subnet public versus private?BeginnerHow do you avoid NAT gateway single points of failure and cross-AZ charges?IntermediateWhen should you use VPC endpoints?IntermediateHow do you design connectivity for 50+ VPCs across accounts and regions?Advanced