Table: aws_ec2_flow_logs

This table shows data for Amazon Elastic Compute Cloud (EC2) Flow Logs.

https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_FlowLog.html (opens in a new tab)

The primary key for this table is arn.

Columns

NameType
_cq_iduuid
_cq_parent_iduuid
account_idutf8
regionutf8
arn (PK)utf8
tagsjson
creation_timetimestamp[us, tz=UTC]
deliver_cross_account_roleutf8
deliver_logs_error_messageutf8
deliver_logs_permission_arnutf8
deliver_logs_statusutf8
destination_optionsjson
flow_log_idutf8
flow_log_statusutf8
log_destinationutf8
log_destination_typeutf8
log_formatutf8
log_group_nameutf8
max_aggregation_intervalint64
resource_idutf8
traffic_typeutf8

Example Queries

These SQL queries are sampled from CloudQuery policies and are compatible with PostgreSQL.

VPC flow logging should be enabled in all VPCs

SELECT
  'VPC flow logging should be enabled in all VPCs' AS title,
  aws_ec2_vpcs.account_id,
  aws_ec2_vpcs.arn,
  CASE
  WHEN aws_ec2_flow_logs.resource_id IS NULL THEN 'fail'
  ELSE 'pass'
  END
FROM
  aws_ec2_vpcs
  LEFT JOIN aws_ec2_flow_logs ON
      aws_ec2_vpcs.vpc_id = aws_ec2_flow_logs.resource_id;