Table: aws_ec2_images

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

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

The composite primary key for this table is (account_id, region, arn).

Relations

The following tables depend on aws_ec2_images:

Columns

NameType
_cq_iduuid
_cq_parent_iduuid
account_id (PK)utf8
region (PK)utf8
arn (PK)utf8
tagsjson
architectureutf8
block_device_mappingsjson
boot_modeutf8
creation_dateutf8
deprecation_timeutf8
descriptionutf8
ena_supportbool
hypervisorutf8
image_idutf8
image_locationutf8
image_owner_aliasutf8
image_typeutf8
imds_supportutf8
kernel_idutf8
nameutf8
owner_idutf8
platformutf8
platform_detailsutf8
product_codesjson
publicbool
ramdisk_idutf8
root_device_nameutf8
root_device_typeutf8
sriov_net_supportutf8
stateutf8
state_reasonjson
tpm_supportutf8
usage_operationutf8
virtualization_typeutf8

Example Queries

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

AMIs should require IMDSv2

SELECT
  'AMIs should require IMDSv2' AS title,
  account_id,
  arn AS resource_id,
  CASE
  WHEN imds_support IS DISTINCT FROM 'v2.0' THEN 'fail'
  ELSE 'pass'
  END
    AS status
FROM
  aws_ec2_images;

Unused own EC2 image

SELECT
  'Unused own EC2 image' AS title,
  account_id,
  arn AS resource_id,
  'fail' AS status
FROM
  aws_ec2_images
WHERE
  COALESCE(jsonb_array_length(block_device_mappings), 0) = 0;