Amazon Web Services (AWS) - Create Transit Gateway using the AWS CLI

by
Jeremy Canfield |
Updated: May 15 2024
| Amazon Web Services (AWS) articles
If you are not familiar with Transit Gateways, check out my article Amazon Web Services (AWS) - Getting Started with Transit Gateway.
The aws ec2 create-transit-gateway command can be used to create a Transit Gateway.
aws ec2 create-transit-gateway \
--description my-transit-gateway \
--options AmazonSideAsn=64516,AutoAcceptSharedAttachments=disable,DefaultRouteTableAssociation=enable,DefaultRouteTablePropagation=enable,VpnEcmpSupport=enable,DnsSupport=enable
And the aws ec2 describe-transit-gateways command should return your Transit Gateway.
~]$ aws ec2 describe-transit-gateways
{
"TransitGateways": [
{
"TransitGatewayId": "tgw-0d92bd9f9b45070a7",
"TransitGatewayArn": "arn:aws:ec2:us-east-1:123456789012:transit-gateway/tgw-0d92bd9f9b45070a7",
"State": "available",
"OwnerId": "123456789012",
"Description": "",
"CreationTime": "2024-05-19T08:25:47+00:00",
"Options": {
"AmazonSideAsn": 64512,
"AutoAcceptSharedAttachments": "disable",
"DefaultRouteTableAssociation": "enable",
"AssociationDefaultRouteTableId": "tgw-rtb-0901a28eecf505a89",
"DefaultRouteTablePropagation": "enable",
"PropagationDefaultRouteTableId": "tgw-rtb-0901a28eecf505a89",
"VpnEcmpSupport": "enable",
"DnsSupport": "enable",
"MulticastSupport": "disable"
},
"Tags": [
{
"Key": "Name",
"Value": "my-transit-gateway"
}
]
}
]
}
Did you find this article helpful?
If so, consider buying me a coffee over at