Table: aws_ec2_ebs_volumes

This table shows data for Amazon Elastic Compute Cloud (EC2) Amazon Elastic Block Store (EBS) Volumes.

https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Volume.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
attachmentsjson
availability_zoneutf8
create_timetimestamp[us, tz=UTC]
encryptedbool
fast_restoredbool
iopsint64
kms_key_idutf8
multi_attach_enabledbool
outpost_arnutf8
sizeint64
snapshot_idutf8
sse_typeutf8
stateutf8
throughputint64
volume_idutf8
volume_typeutf8

Example Queries

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

Detached EBS volume

SELECT
  'Detached EBS volume' AS title,
  account_id,
  arn AS resource_id,
  'fail' AS status
FROM
  aws_ec2_ebs_volumes
WHERE
  COALESCE(jsonb_array_length(attachments), 0) = 0;

Attached EBS volumes should be encrypted at rest

SELECT
  'Attached EBS volumes should be encrypted at rest' AS title,
  account_id,
  arn AS resource_id,
  CASE WHEN encrypted IS false THEN 'fail' ELSE 'pass' END AS status
FROM
  aws_ec2_ebs_volumes;