Table: aws_ec2_transit_gateway_attachments

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

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

The primary key for this table is _cq_id.

Relations

This table depends on aws_ec2_transit_gateways.

Columns

NameType
_cq_id (PK)uuid
_cq_parent_iduuid
account_idutf8
regionutf8
transit_gateway_arnutf8
tagsjson
associationjson
creation_timetimestamp[us, tz=UTC]
resource_idutf8
resource_owner_idutf8
resource_typeutf8
stateutf8
transit_gateway_attachment_idutf8
transit_gateway_idutf8
transit_gateway_owner_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;