Get information on an EC2 Transit Gateway's attachment to a resource.
data "aws_ec2_transit_gateway_attachment" "example" {
filter {
name = "transit-gateway-id"
values = [aws_ec2_transit_gateway.example.id]
}
filter {
name = "resource-type"
values = ["peering"]
}
}
This data source supports the following arguments:
filter
- (Optional) One or more configuration blocks containing name-values filters. Detailed below.transit_gateway_attachment_id
- (Optional) ID of the attachment.name
- (Required) Name of the field to filter by, as defined by the underlying AWS API.values
- (Required) List of one or more values for the filter.This data source exports the following attributes in addition to the arguments above:
arn
- ARN of the attachment.association_state
- The state of the association (see the underlying AWS API for valid values).association_transit_gateway_route_table_id
- The ID of the route table for the transit gateway.resource_id
- ID of the resource.resource_owner_id
- ID of the AWS account that owns the resource.resource_type
- Resource type.state
- Attachment state.tags
- Key-value tags for the attachment.transit_gateway_id
- ID of the transit gateway.transit_gateway_owner_id
- The ID of the AWS account that owns the transit gateway.