We recommend new projects start with resources from the AWS provider.
aws-native.ec2.Route
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
Specifies a route in a route table. For more information, see 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 attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a DependsOn Attribute in the AWS::EC2::Route resource to explicitly declare a dependency on the AWS::EC2::TransitGatewayAttachment resource.
Create Route Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);@overload
def Route(resource_name: str,
          args: RouteArgs,
          opts: Optional[ResourceOptions] = None)
@overload
def Route(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          route_table_id: Optional[str] = None,
          gateway_id: Optional[str] = None,
          local_gateway_id: Optional[str] = None,
          destination_ipv6_cidr_block: Optional[str] = None,
          destination_prefix_list_id: Optional[str] = None,
          egress_only_internet_gateway_id: Optional[str] = None,
          carrier_gateway_id: Optional[str] = None,
          instance_id: Optional[str] = None,
          destination_cidr_block: Optional[str] = None,
          nat_gateway_id: Optional[str] = None,
          network_interface_id: Optional[str] = None,
          core_network_arn: Optional[str] = None,
          transit_gateway_id: Optional[str] = None,
          vpc_endpoint_id: Optional[str] = None,
          vpc_peering_connection_id: Optional[str] = None)func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)type: aws-native:ec2:Route
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Route Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Route resource accepts the following input properties:
- RouteTable stringId 
- The ID of the route table for the route.
- CarrierGateway stringId 
- The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
- CoreNetwork stringArn 
- The Amazon Resource Name (ARN) of the core network.
- DestinationCidr stringBlock 
- The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to100.68.0.0/18.
- DestinationIpv6Cidr stringBlock 
- The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- DestinationPrefix stringList Id 
- The ID of a prefix list used for the destination match.
- EgressOnly stringInternet Gateway Id 
- [IPv6 traffic only] The ID of an egress-only internet gateway.
- GatewayId string
- The ID of an internet gateway or virtual private gateway attached to your VPC.
- InstanceId string
- The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
- LocalGateway stringId 
- The ID of the local gateway.
- NatGateway stringId 
- [IPv4 traffic only] The ID of a NAT gateway.
- NetworkInterface stringId 
- The ID of a network interface.
- TransitGateway stringId 
- The ID of a transit gateway.
- VpcEndpoint stringId 
- The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- VpcPeering stringConnection Id 
- The ID of a VPC peering connection.
- RouteTable stringId 
- The ID of the route table for the route.
- CarrierGateway stringId 
- The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
- CoreNetwork stringArn 
- The Amazon Resource Name (ARN) of the core network.
- DestinationCidr stringBlock 
- The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to100.68.0.0/18.
- DestinationIpv6Cidr stringBlock 
- The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- DestinationPrefix stringList Id 
- The ID of a prefix list used for the destination match.
- EgressOnly stringInternet Gateway Id 
- [IPv6 traffic only] The ID of an egress-only internet gateway.
- GatewayId string
- The ID of an internet gateway or virtual private gateway attached to your VPC.
- InstanceId string
- The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
- LocalGateway stringId 
- The ID of the local gateway.
- NatGateway stringId 
- [IPv4 traffic only] The ID of a NAT gateway.
- NetworkInterface stringId 
- The ID of a network interface.
- TransitGateway stringId 
- The ID of a transit gateway.
- VpcEndpoint stringId 
- The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- VpcPeering stringConnection Id 
- The ID of a VPC peering connection.
- routeTable StringId 
- The ID of the route table for the route.
- carrierGateway StringId 
- The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
- coreNetwork StringArn 
- The Amazon Resource Name (ARN) of the core network.
- destinationCidr StringBlock 
- The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to100.68.0.0/18.
- destinationIpv6Cidr StringBlock 
- The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destinationPrefix StringList Id 
- The ID of a prefix list used for the destination match.
- egressOnly StringInternet Gateway Id 
- [IPv6 traffic only] The ID of an egress-only internet gateway.
- gatewayId String
- The ID of an internet gateway or virtual private gateway attached to your VPC.
- instanceId String
- The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
- localGateway StringId 
- The ID of the local gateway.
- natGateway StringId 
- [IPv4 traffic only] The ID of a NAT gateway.
- networkInterface StringId 
- The ID of a network interface.
- transitGateway StringId 
- The ID of a transit gateway.
- vpcEndpoint StringId 
- The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpcPeering StringConnection Id 
- The ID of a VPC peering connection.
- routeTable stringId 
- The ID of the route table for the route.
- carrierGateway stringId 
- The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
- coreNetwork stringArn 
- The Amazon Resource Name (ARN) of the core network.
- destinationCidr stringBlock 
- The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to100.68.0.0/18.
- destinationIpv6Cidr stringBlock 
- The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destinationPrefix stringList Id 
- The ID of a prefix list used for the destination match.
- egressOnly stringInternet Gateway Id 
- [IPv6 traffic only] The ID of an egress-only internet gateway.
- gatewayId string
- The ID of an internet gateway or virtual private gateway attached to your VPC.
- instanceId string
- The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
- localGateway stringId 
- The ID of the local gateway.
- natGateway stringId 
- [IPv4 traffic only] The ID of a NAT gateway.
- networkInterface stringId 
- The ID of a network interface.
- transitGateway stringId 
- The ID of a transit gateway.
- vpcEndpoint stringId 
- The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpcPeering stringConnection Id 
- The ID of a VPC peering connection.
- route_table_ strid 
- The ID of the route table for the route.
- carrier_gateway_ strid 
- The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
- core_network_ strarn 
- The Amazon Resource Name (ARN) of the core network.
- destination_cidr_ strblock 
- The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to100.68.0.0/18.
- destination_ipv6_ strcidr_ block 
- The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destination_prefix_ strlist_ id 
- The ID of a prefix list used for the destination match.
- egress_only_ strinternet_ gateway_ id 
- [IPv6 traffic only] The ID of an egress-only internet gateway.
- gateway_id str
- The ID of an internet gateway or virtual private gateway attached to your VPC.
- instance_id str
- The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
- local_gateway_ strid 
- The ID of the local gateway.
- nat_gateway_ strid 
- [IPv4 traffic only] The ID of a NAT gateway.
- network_interface_ strid 
- The ID of a network interface.
- transit_gateway_ strid 
- The ID of a transit gateway.
- vpc_endpoint_ strid 
- The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpc_peering_ strconnection_ id 
- The ID of a VPC peering connection.
- routeTable StringId 
- The ID of the route table for the route.
- carrierGateway StringId 
- The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
- coreNetwork StringArn 
- The Amazon Resource Name (ARN) of the core network.
- destinationCidr StringBlock 
- The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to100.68.0.0/18.
- destinationIpv6Cidr StringBlock 
- The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destinationPrefix StringList Id 
- The ID of a prefix list used for the destination match.
- egressOnly StringInternet Gateway Id 
- [IPv6 traffic only] The ID of an egress-only internet gateway.
- gatewayId String
- The ID of an internet gateway or virtual private gateway attached to your VPC.
- instanceId String
- The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
- localGateway StringId 
- The ID of the local gateway.
- natGateway StringId 
- [IPv4 traffic only] The ID of a NAT gateway.
- networkInterface StringId 
- The ID of a network interface.
- transitGateway StringId 
- The ID of a transit gateway.
- vpcEndpoint StringId 
- The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpcPeering StringConnection Id 
- The ID of a VPC peering connection.
Outputs
All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:
- cidr_block str
- The IPv4 CIDR block.
- id str
- The provider-assigned unique ID for this managed resource.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.