How do you log network traffic in production without a huge bill?
IntermediateProductionVPC and Network Design
Answer
VPC Flow Logs to S3 in Parquet format with hourly partitions (much cheaper than CloudWatch Logs and query-able with Athena). Use a custom format with useful fields (vpc-id, subnet-id, pkt-srcaddr, pkt-dstaddr, flow-direction, traffic-path). Enable at VPC level in prod, and sample or disable in sandboxes. Lifecycle old logs to Glacier. Send only REJECT records to CloudWatch if you need real-time alerting.
More on VPC and Network Design
Walk through a production VPC layout for a multi-tier app.BeginnerHow do you size VPC CIDRs to avoid painting yourself into a corner?IntermediateOne NAT gateway or one per AZ?BeginnerWhat are the biggest levers to reduce NAT gateway cost?IntermediateWhich VPC endpoints do you create by default in a private EKS or ECS VPC?IntermediateHow do you lock down what can go through a VPC endpoint?Advanced