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_statefrom aws_ec2_transit_gateway_vpc_attachment;
select transit_gateway_attachment_id, transit_gateway_id, state, transit_gateway_owner_id, creation_time, association_statefrom 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 countfrom aws_ec2_transit_gateway_vpc_attachmentgroup by resource_type;
select resource_type, count(transit_gateway_attachment_id) as countfrom aws_ec2_transit_gateway_vpc_attachmentgroup by resource_type;
Schema for aws_ec2_transit_gateway_vpc_attachment
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
association_state | text | = | The state of the association. |
association_transit_gateway_route_table_id | text | = | The ID of the route table for the transit gateway. |
creation_time | timestamp with time zone | The creation time of the transit gateway attachment. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
resource_id | text | = | The ID of the resource. |
resource_owner_id | text | = | The ID of the AWS account that owns the resource. |
resource_type | text | = | The resource type of the transit gateway attachment. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
state | text | = | The attachment state of the transit gateway attachment. |
tags | jsonb | A map of tags for the resource. | |
tags_src | jsonb | A list of tags assigned. | |
title | text | Title of the resource. | |
transit_gateway_attachment_id | text | = | The ID of the transit gateway attachment. |
transit_gateway_id | text | = | The ID of the transit gateway. |
transit_gateway_owner_id | text | = | 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