steampipe plugin install aws

Table: aws_ec2_transit_gateway_vpc_attachment - Query AWS EC2 Transit Gateway VPC Attachments using SQL

The AWS EC2 Transit Gateway VPC Attachment is a resource that allows you to attach an Amazon VPC to a transit gateway. This attachment enables connectivity between the VPC and other networks connected to the transit gateway. It simplifies network architecture, reduces operational overhead, and provides a central gateway for connectivity.

Table Usage Guide

The aws_ec2_transit_gateway_vpc_attachment table in Steampipe provides you with information about the attachments between Virtual Private Clouds (VPCs) and transit gateways in Amazon Elastic Compute Cloud (EC2). This table allows you, as a DevOps engineer, to query attachment-specific details, including the attachment state, creation time, and associated metadata. You can utilize this table to gather insights on attachments, such as their status, the VPCs they are associated with, the transit gateways they are connected to, and more. The schema outlines the various attributes of the transit gateway VPC attachment for you, including the attachment ID, transit gateway ID, VPC ID, and associated tags.

Examples

Basic transit gateway vpc attachment info

Determine the areas in which your AWS EC2 Transit Gateway is attached to a VPC. This helps you understand the status and ownership of these connections, as well as when they were created.

select
transit_gateway_attachment_id,
transit_gateway_id,
state,
transit_gateway_owner_id,
creation_time,
association_state
from
aws_ec2_transit_gateway_vpc_attachment;
select
transit_gateway_attachment_id,
transit_gateway_id,
state,
transit_gateway_owner_id,
creation_time,
association_state
from
aws_ec2_transit_gateway_vpc_attachment;

Count of transit gateway vpc attachment by transit gateway id

Analyze your AWS EC2 Transit Gateway setup to understand the distribution of VPC attachments across different types of resources. This could be useful in optimizing resource allocation and identifying potential areas for cost savings.

select
resource_type,
count(transit_gateway_attachment_id) as count
from
aws_ec2_transit_gateway_vpc_attachment
group by
resource_type;
select
resource_type,
count(transit_gateway_attachment_id) as count
from
aws_ec2_transit_gateway_vpc_attachment
group by
resource_type;

Schema for aws_ec2_transit_gateway_vpc_attachment

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The AWS Account ID in which the resource is located.
akasjsonbArray of globally unique identifier strings (also known as) for the resource.
association_statetext=The state of the association.
association_transit_gateway_route_table_idtext=The ID of the route table for the transit gateway.
creation_timetimestamp with time zoneThe creation time of the transit gateway attachment.
partitiontextThe AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov).
regiontextThe AWS Region in which the resource is located.
resource_idtext=The ID of the resource.
resource_owner_idtext=The ID of the AWS account that owns the resource.
resource_typetext=The resource type of the transit gateway attachment.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
statetext=The attachment state of the transit gateway attachment.
tagsjsonbA map of tags for the resource.
tags_srcjsonbA list of tags assigned.
titletextTitle of the resource.
transit_gateway_attachment_idtext=The ID of the transit gateway attachment.
transit_gateway_idtext=The ID of the transit gateway.
transit_gateway_owner_idtext=The ID of the AWS account that owns the transit gateway.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws

You can pass the configuration to the command with the --config argument:

steampipe_export_aws --config '<your_config>' aws_ec2_transit_gateway_vpc_attachment