Skip to main content

transit_gateways

Creates, updates, deletes, gets or lists a transit_gateways resource.

Overview

Nametransit_gateways
TypeResource
Idaws.ec2.transit_gateways

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_timestringThe creation time.
descriptionstringThe description of the transit gateway.
optionsstringThe transit gateway options.
owner_idstringThe ID of the Amazon Web Services account that owns the transit gateway.
statestringThe state of the transit gateway.
tagsstringThe tags for the transit gateway.
transit_gateway_arnstringThe Amazon Resource Name (ARN) of the transit gateway.
transit_gateway_idstringThe ID of the transit gateway.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_transit_gatewaysselectregionTransitGatewayIds, Filter, MaxResults, NextToken, DryRunDescribes one or more transit gateways. By default, all transit gateways are described. Alternatively, you can filter the results.
create_transit_gatewayinsertregionDescription, Options, TagSpecification, DryRunCreates a transit gateway. You can use a transit gateway to interconnect your virtual private clouds (VPC) and on-premises networks. After the transit gateway enters the available state, you can attach your VPCs and VPN connections to the transit gateway. To attach your VPCs, use CreateTransitGatewayVpcAttachment. To attach a VPN connection, use CreateCustomerGateway to create a customer gateway and specify the ID of the customer gateway and the ID of the transit gateway in a call to CreateVpnConnection. When you create a transit gateway, we create a default transit gateway route table and use it as the default association route table and the default propagation route table. You can use CreateTransitGatewayRouteTable to create additional transit gateway route tables. If you disable automatic route propagation, we do not create a default transit gateway route table. You can use EnableTransitGatewayRouteTablePropagation to propagate routes from a resource attachment to a transit gateway route table. If you disable automatic associations, you can use AssociateTransitGatewayRouteTable to associate a resource attachment with a transit gateway route table.
modify_transit_gatewayupdateTransitGatewayId, regionDescription, Options, DryRunModifies the specified transit gateway. When you modify a transit gateway, the modified options are applied to new transit gateway attachments only. Your existing transit gateway attachments are not modified.
delete_transit_gatewaydeleteTransitGatewayId, regionDryRunDeletes the specified transit gateway.
delete_transit_gateway_client_vpn_attachmentdeleteTransitGatewayAttachmentId, regionDryRunDeletes a Transit Gateway attachment for a Client VPN endpoint. The Transit Gateway owner can delete the attachment to remove the association between the Client VPN endpoint and the Transit Gateway.
accept_transit_gateway_client_vpn_attachmentexecTransitGatewayAttachmentId, regionDryRunAccepts a Transit Gateway attachment request for a Client VPN endpoint. The Transit Gateway owner must accept the attachment request before the Client VPN endpoint can route traffic through the Transit Gateway.
accept_transit_gateway_peering_attachmentexecTransitGatewayAttachmentId, regionDryRunAccepts a transit gateway peering attachment request. The peering attachment must be in the pendingAcceptance state.
accept_transit_gateway_vpc_attachmentexecTransitGatewayAttachmentId, regionDryRunAccepts a request to attach a VPC to a transit gateway. The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use RejectTransitGatewayVpcAttachment to reject a VPC attachment request.
reject_transit_gateway_client_vpn_attachmentexecTransitGatewayAttachmentId, regionDryRunRejects a Transit Gateway attachment request for a Client VPN endpoint. The Transit Gateway owner can reject the attachment request to prevent the Client VPN endpoint from routing traffic through the Transit Gateway.
reject_transit_gateway_peering_attachmentexecTransitGatewayAttachmentId, regionDryRunRejects a transit gateway peering attachment request.
reject_transit_gateway_vpc_attachmentexecTransitGatewayAttachmentId, regionDryRunRejects a request to attach a VPC to a transit gateway. The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments to view your pending VPC attachment requests. Use AcceptTransitGatewayVpcAttachment to accept a VPC attachment request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
TransitGatewayAttachmentIdstringThe ID of the attachment.
TransitGatewayIdstringThe ID of the transit gateway.
regionstringAWS region (default: us-east-1)
DescriptionstringThe description for the transit gateway.
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
FilterarrayOne or more filters. The possible values are: options.propagation-default-route-table-id - The ID of the default propagation route table. options.amazon-side-asn - The private ASN for the Amazon side of a BGP session. options.association-default-route-table-id - The ID of the default association route table. options.auto-accept-shared-attachments - Indicates whether there is automatic acceptance of attachment requests (enable | disable). options.default-route-table-association - Indicates whether resource attachments are automatically associated with the default association route table (enable | disable). options.default-route-table-propagation - Indicates whether resource attachments automatically propagate routes to the default propagation route table (enable | disable). options.dns-support - Indicates whether DNS support is enabled (enable | disable). options.vpn-ecmp-support - Indicates whether Equal Cost Multipath Protocol support is enabled (enable | disable). owner-id - The ID of the Amazon Web Services account that owns the transit gateway. state - The state of the transit gateway (available | deleted | deleting | modifying | pending). transit-gateway-id - The ID of the transit gateway. tag-key - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.
MaxResultsintegerThe maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.
NextTokenstringThe token for the next page of results.
OptionsobjectThe options to modify.
TagSpecificationarrayThe tags to apply to the transit gateway.
TransitGatewayIdsarrayThe IDs of the transit gateways.

SELECT examples

Describes one or more transit gateways. By default, all transit gateways are described. Alternatively, you can filter the results.

SELECT
creation_time,
description,
options,
owner_id,
state,
tags,
transit_gateway_arn,
transit_gateway_id
FROM aws.ec2.transit_gateways
WHERE region = '{{ region }}' -- required
AND TransitGatewayIds = '{{ TransitGatewayIds }}'
AND Filter = '{{ Filter }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
;

INSERT examples

Creates a transit gateway. You can use a transit gateway to interconnect your virtual private clouds (VPC) and on-premises networks. After the transit gateway enters the available state, you can attach your VPCs and VPN connections to the transit gateway. To attach your VPCs, use CreateTransitGatewayVpcAttachment. To attach a VPN connection, use CreateCustomerGateway to create a customer gateway and specify the ID of the customer gateway and the ID of the transit gateway in a call to CreateVpnConnection. When you create a transit gateway, we create a default transit gateway route table and use it as the default association route table and the default propagation route table. You can use CreateTransitGatewayRouteTable to create additional transit gateway route tables. If you disable automatic route propagation, we do not create a default transit gateway route table. You can use EnableTransitGatewayRouteTablePropagation to propagate routes from a resource attachment to a transit gateway route table. If you disable automatic associations, you can use AssociateTransitGatewayRouteTable to associate a resource attachment with a transit gateway route table.

INSERT INTO aws.ec2.transit_gateways (
region,
Description,
Options,
TagSpecification,
DryRun
)
SELECT
'{{ region }}',
'{{ Description }}',
'{{ Options }}',
'{{ TagSpecification }}',
'{{ DryRun }}'
RETURNING
creation_time,
description,
options,
owner_id,
state,
tags,
transit_gateway_arn,
transit_gateway_id
;

UPDATE examples

Modifies the specified transit gateway. When you modify a transit gateway, the modified options are applied to new transit gateway attachments only. Your existing transit gateway attachments are not modified.

UPDATE aws.ec2.transit_gateways
SET
-- No updatable properties
WHERE
TransitGatewayId = '{{ TransitGatewayId }}' --required
AND region = '{{ region }}' --required
AND Description = '{{ Description}}'
AND Options = '{{ Options}}'
AND DryRun = {{ DryRun}}
RETURNING
creation_time,
description,
options,
owner_id,
state,
tags,
transit_gateway_arn,
transit_gateway_id;

DELETE examples

Deletes the specified transit gateway.

DELETE FROM aws.ec2.transit_gateways
WHERE TransitGatewayId = '{{ TransitGatewayId }}' --required
AND region = '{{ region }}' --required
AND DryRun = '{{ DryRun }}'
;

Lifecycle Methods

Accepts a Transit Gateway attachment request for a Client VPN endpoint. The Transit Gateway owner must accept the attachment request before the Client VPN endpoint can route traffic through the Transit Gateway.

EXEC aws.ec2.transit_gateways.accept_transit_gateway_client_vpn_attachment
@TransitGatewayAttachmentId='{{ TransitGatewayAttachmentId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;