Lesson 077 · AWS Learning Path

AWS 077: VPC Flow Logs

· Published · 7 min read

Network flows from several VPC interfaces become accepted and rejected metadata records for searchable investigation

The problem

A team uses VPC Flow Logs as a label or Console setting without proving the identity, scope, behavior, failure boundary, cost, or operational result. The configuration appears complete but the real requirement remains untested.

Final outcome

The learner will inspect, explain, test, and document VPC Flow Logs. The submission must connect the Console and CLI view to the same AWS control, state what the evidence proves, diagnose one likely failure, and make a requirement-based architecture decision.

Learning outcomes

You will be able to:

  1. explain flow logs record network-flow metadata;
  2. explain capture scope can be vpc, subnet, or eni;
  3. explain filters are accept, reject, or all;
  4. explain destinations include cloudwatch logs, s3, and firehose;
  5. explain delivery is best effort;
  1. distinguish successful configuration from successful workload behavior;
  2. preserve redacted evidence and complete the stated cleanup or retention decision.

Mental model

requirement
   -> identity and permission
   -> account, Region, and resource scope
   -> configuration or request
   -> observable state
   -> workload result
   -> failure evidence
   -> cleanup or controlled retention

Never begin with a create button or a copied command. Start with the result that must be proven and the boundary that must remain protected.

Core facts

ConceptWhat it means in practice
Flow Logs record network-flow metadataA record can include source and destination addresses, ports, protocol, packets, bytes, interface, action, timestamps, and additional fields. It does not capture packet payload.
Capture scope can be VPC, subnet, or ENIA broader scope creates records for included network interfaces. New interfaces under a selected VPC or subnet are incorporated as supported.
Filters are ACCEPT, REJECT, or ALLACCEPT shows traffic permitted by security groups and NACLs; REJECT shows rejected traffic. A successful acceptance does not prove the application answered.
Destinations include CloudWatch Logs, S3, and FirehoseChoose the destination and format for query, retention, delivery, and central analytics requirements. Permissions and delivery roles must be correct.
Delivery is best effortRecords are aggregated and delivered after the traffic. They are diagnostic evidence, not an inline firewall or a guaranteed real-time packet ledger.
Some traffic is not loggedDocumented exclusions include traffic to the Amazon DNS server, instance metadata, DHCP, and certain service-generated paths. Know exclusions before concluding that no record means no packet.

How to reason about it

Start with the five-tuple and time window, then read action, interface, and route context. REJECT often points to SG or NACL policy. ACCEPT with no application response shifts attention to return routing, host firewall, listener, TLS, and application behavior.

Use the following decision table as a starting point, then change the answer when the scenario changes.

RequirementPreferred directionWhy
Fast operational search and alarmsCloudWatch Logs destination and Logs InsightsTeams can query and alert near their operational tooling.
Long retention and large-scale analyticsS3 destination with partitioned formatObject storage supports lifecycle and engines such as Athena.
Need packet contentsVPC Traffic Mirroring or host capture where appropriateFlow Logs contain metadata, not payload.
Investigate only rejected connectionsREJECT filter during focused analysisIt reduces volume but omits permitted flows needed for complete baselines.

Prerequisites, permissions, Region, and cost

Run this lesson as the approved non-root course identity. Begin with aws sts get-caller-identity, confirm the private account record, and set the fixed project Region before any regional query. IAM resources are global within an account, while STS endpoints and the services reached by an identity can be regional.

Use only the read or change actions required for this lesson. An AccessDenied result is evidence to analyse, not permission to switch to root or attach AdministratorAccess. Record the action, resource, principal type, request context, and smallest justified correction.

The listed cost tier is T0 - no resource creation. Free Tier eligibility and credits are account-specific. Before a mutating lab, identify every resource that can charge, estimate its duration, start a timer, and write the reverse cleanup order. A budget reports cost after billing data arrives and is not a real-time stop control.

AWS Management Console method

  1. Open VPC Flow Logs from a VPC, subnet, or network-interface page.
  2. Inspect traffic filter, maximum aggregation interval, destination, log format, and delivery status.
  3. Open CloudWatch Logs Insights or Athena for the selected destination and query source, destination, port, action, interface, and time.

For every step record the service page, selected account and Region, exact object, visible state, and why that state matters. A Console label or green status is not enough unless it is tied to the final workload outcome.

AWS CLI or API evidence

List flow-log scope, filter, destination, delivery state, and format.

aws ec2 describe-flow-logs --filter Name=resource-id,Values=vpc-0123456789abcdef0 --query 'FlowLogs[].{Id:FlowLogId,Traffic:TrafficType,Destination:LogDestinationType,Status:DeliverLogsStatus,Format:LogFormat}' --output table

ACTIVE configuration is not proof of a particular packet record. Check aggregation time, destination delivery, queried fields, ENI scope, and documented exclusions.

Before running the command, replace every placeholder, explain each option, and decide whether the operation is read-only or mutating. Capture the exit code immediately. Redact account IDs, ARNs, public addresses, request identifiers, and personal data before sharing.

The CLI and Console are clients of AWS APIs. Matching state across them increases confidence, but neither substitutes for data-plane or application verification.

Practical work

Create p04-flow-log-plan.md for the project VPC. Choose scope, ACCEPT/REJECT/ALL filter, log format fields, destination, retention, KMS and IAM requirements, expected ingestion/query cost, and deletion order. Decode supplied ACCEPT, REJECT, NODATA, and SKIPDATA examples. Do not create a Flow Log until its destination cost and cleanup are approved.

The evidence package must include:

  • non-root principal type, account verified privately, and Region;
  • exact intended and observed state;
  • one Console observation and the matching CLI or API result;
  • one successful result and one denied, failed, or counterexample result;
  • what each result does not prove;
  • cost state and elapsed lab time;
  • cleanup evidence or a named retained-state owner and next lesson.

Verification standard

Use three levels of proof:

  1. Control plane: the object or policy exists with the intended configuration.
  2. Data plane or behavior: the request, packet, session, storage path, or application does what the requirement states.
  3. Operations: monitoring, failure diagnosis, cost, ownership, and cleanup are known.

A control-plane response can precede final readiness. Use waiters or state polling where supported, then test the actual behavior. If a request times out, do not assume it failed. Inspect state and use documented idempotency before retrying a mutation.

Troubleshooting method

SymptomEvidence firstSmallest safe response
command cannot authenticatecredential source, expiry, caller preflightrestore approved temporary login
access is deniedaction, resource, principal, all policy layerscorrect only the missing or conflicting control
object appears missingaccount, Region, filters, pagination, permissionalign scope before creating anything
configured state exists but behavior failsroute, identity, dependency, logs, service statetest the next boundary in the path
cleanup is blockeddependency inventory and owning serviceremove dependants in reviewed reverse order

Keep the original symptom and timestamp. State one hypothesis, make one reversible change, repeat the original test, and record rollback. Never open a management port to the world, expose credentials, disable TLS verification, format an unknown disk, or add broad permissions as a generic fix.

Architecture and certification decisions

Professional-level questions provide competing valid features. Identify the requirement that decides between them: human or workload identity, same-account or cross-account access, regional or zonal scope, stateful or stateless filtering, durable or ephemeral data, latency, RTO/RPO, cost, or operational ownership.

Explain why the selected option fits and why each plausible alternative fails one stated requirement. Do not rely on feature memorization or reproduce protected certification questions.

Knowledge check

  1. Can Flow Logs show the HTTP request body?

Expected direction: No. They record flow metadata, not packet payload.

  1. Does ACCEPT prove the web server returned 200?

Expected direction: No. It shows the network controls accepted the flow, not application success.

  1. Why might a DNS request to the Amazon resolver have no record?

Expected direction: That traffic is among documented Flow Logs exclusions.

  1. Are Flow Logs an inline deny control?

Expected direction: No. They observe traffic; security controls enforce it.

Cost, cleanup, and retained state

Retain only the state explicitly required by the next P04 lesson and record it in the private resource ledger.

Cleanup evidence includes the final state query, not only a successful delete response. Search related resources, other Regions used by the lab, retained storage, public IPv4 addresses, logging destinations, and service-managed dependencies. Schedule a later billing review because cost data can lag.

Completion gate

Pass when the practical artifact explains the real problem, matches Console and CLI evidence, answers every knowledge check, diagnoses one failure without broadening access, records cost, and proves cleanup or approved retention. The learner must defend one decision orally and name the requirement that would change it.

Official sources

Advertisement