Table: aws_ec2_transit_gateways

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

https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TransitGateway.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_transit_gateways:

Columns

NameType
_cq_iduuid
_cq_parent_iduuid
account_id (PK)utf8
region (PK)utf8
idutf8
arn (PK)utf8
tagsjson
creation_timetimestamp[us, tz=UTC]
descriptionutf8
optionsjson
owner_idutf8
stateutf8
transit_gateway_arnutf8
transit_gateway_idutf8

Example Queries

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

Unused transit gateway

WITH
  attachment
    AS (
      SELECT
        DISTINCT transit_gateway_arn
      FROM
        aws_ec2_transit_gateway_attachments
    )
SELECT
  'Unused transit gateway' AS title,
  gateway.account_id,
  gateway.arn AS resource_id,
  'fail' AS status
FROM
  aws_ec2_transit_gateways AS gateway
  LEFT JOIN attachment ON attachment.transit_gateway_arn = gateway.arn
WHERE
  attachment.transit_gateway_arn IS NULL;