HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/examples/ec2/create-transit-gateway-route.rst
**To create a Transit Gateway Route**

The following ``create-transit-gateway-route`` example creates a route for the specified route table. ::

    aws ec2 create-transit-gateway-route \
        --destination-cidr-block 10.0.2.0/24 \
        --transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE \
        --transit-gateway-attachment-id tgw-attach-0b5968d3b6EXAMPLE

Output::

    {
        "Route": {
            "DestinationCidrBlock": "10.0.2.0/24",
            "TransitGatewayAttachments": [
                {
                    "ResourceId": "vpc-0065acced4EXAMPLE",
                    "TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE",
                    "ResourceType": "vpc"
                }
            ],
            "Type": "static",
            "State": "active"
        }
    }

For more information, see `Create a Transit Gateway Route <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#create-tgw-route-table>`__ in the *AWS Transit Gateways Guide*.