Skip to content

EC2  >  Operations  >  create_transit_gateway

create_transit_gateway

Operation

create_transit_gateway async

create_transit_gateway(input: CreateTransitGatewayInput, plugins: list[Plugin] | None = None) -> CreateTransitGatewayOutput

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.

Parameters:

Name Type Description Default
input CreateTransitGatewayInput

An instance of CreateTransitGatewayInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateTransitGatewayOutput

An instance of CreateTransitGatewayOutput.

Input

CreateTransitGatewayInput dataclass

Bases: _SerdeShape

Dataclass for CreateTransitGatewayInput structure.

Attributes

description class-attribute instance-attribute
description: str | None = ...

A description of the transit gateway.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

Checks 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.

options class-attribute instance-attribute
options: TransitGatewayRequestOptions | None = ...

The transit gateway options.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to apply to the transit gateway.

Output

CreateTransitGatewayOutput dataclass

Bases: _SerdeShape

Dataclass for CreateTransitGatewayOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

transit_gateway class-attribute instance-attribute
transit_gateway: TransitGateway | None = ...

Information about the transit gateway.