AWS Fundamentals Logo
AWS Fundamentals
AWS::EC2::Route

EC2 Route

Specifies a route in a route table. For more information, see [Routes](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html#route-table-routes) in the *Amazon VPC User Guide*. You must specify either a destination CIDR block or prefix list ID. You must also specify exactly one of the resources as the target. If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway...

Properties

15 configurable properties. 1 required. Click a row to see details.

Filter:
PropertyTypeFlags
RouteTableId
string
RequiredCreate-only
CarrierGatewayId
string
CoreNetworkArn
string
DestinationCidrBlock
string
Create-only
DestinationIpv6CidrBlock
string
Create-only
DestinationPrefixListId
string
Create-only
EgressOnlyInternetGatewayId
string
GatewayId
string
InstanceId
string
LocalGatewayId
string
NatGatewayId
string
NetworkInterfaceId
string
TransitGatewayId
string
VpcEndpointId
string
VpcPeeringConnectionId
string

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
CidrBlockstring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::Route

Resources:
  MyResource:
    Type: AWS::EC2::Route
    Properties:
      RouteTableId: "my-routetableid"

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

create

ec2:CreateRouteec2:DescribeRouteTablesec2:DescribeNetworkInterfaces

read

ec2:DescribeRouteTables

update

ec2:ReplaceRouteec2:DescribeRouteTablesec2:DescribeNetworkInterfaces

delete

ec2:DeleteRouteec2:DescribeRouteTables

list

ec2:DescribeRouteTables

Get the EC2 Cheat Sheet

Everything you need to know about EC2 on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceEC2
Properties16
Required1
TaggingNot supported
Primary IDRouteTableId

Supported Operations

CreateReadUpdateDeleteList

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

RouteTableIdDestinationCidrBlockDestinationIpv6CidrBlockDestinationPrefixListId

External Links