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:
- Route
Table stringId - The ID of the route table for the route.
- Carrier
Gateway 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.
- Core
Network stringArn - The Amazon Resource Name (ARN) of the core network.
- Destination
Cidr 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
. - Destination
Ipv6Cidr stringBlock - The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- Destination
Prefix stringList Id - The ID of a prefix list used for the destination match.
- Egress
Only stringInternet Gateway Id - [IPv6 traffic only] The ID of an egress-only internet gateway.
- Gateway
Id string - The ID of an internet gateway or virtual private gateway attached to your VPC.
- Instance
Id 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.
- Local
Gateway stringId - The ID of the local gateway.
- Nat
Gateway stringId - [IPv4 traffic only] The ID of a NAT gateway.
- Network
Interface stringId - The ID of a network interface.
- Transit
Gateway stringId - The ID of a transit gateway.
- Vpc
Endpoint stringId - The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- Vpc
Peering stringConnection Id - The ID of a VPC peering connection.
- Route
Table stringId - The ID of the route table for the route.
- Carrier
Gateway 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.
- Core
Network stringArn - The Amazon Resource Name (ARN) of the core network.
- Destination
Cidr 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
. - Destination
Ipv6Cidr stringBlock - The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- Destination
Prefix stringList Id - The ID of a prefix list used for the destination match.
- Egress
Only stringInternet Gateway Id - [IPv6 traffic only] The ID of an egress-only internet gateway.
- Gateway
Id string - The ID of an internet gateway or virtual private gateway attached to your VPC.
- Instance
Id 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.
- Local
Gateway stringId - The ID of the local gateway.
- Nat
Gateway stringId - [IPv4 traffic only] The ID of a NAT gateway.
- Network
Interface stringId - The ID of a network interface.
- Transit
Gateway stringId - The ID of a transit gateway.
- Vpc
Endpoint stringId - The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- Vpc
Peering stringConnection Id - The ID of a VPC peering connection.
- route
Table StringId - The ID of the route table for the route.
- carrier
Gateway 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.
- core
Network StringArn - The Amazon Resource Name (ARN) of the core network.
- destination
Cidr 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
. - destination
Ipv6Cidr StringBlock - The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destination
Prefix StringList Id - The ID of a prefix list used for the destination match.
- egress
Only StringInternet Gateway Id - [IPv6 traffic only] The ID of an egress-only internet gateway.
- gateway
Id String - The ID of an internet gateway or virtual private gateway attached to your VPC.
- instance
Id 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.
- local
Gateway StringId - The ID of the local gateway.
- nat
Gateway StringId - [IPv4 traffic only] The ID of a NAT gateway.
- network
Interface StringId - The ID of a network interface.
- transit
Gateway StringId - The ID of a transit gateway.
- vpc
Endpoint StringId - The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpc
Peering StringConnection Id - The ID of a VPC peering connection.
- route
Table stringId - The ID of the route table for the route.
- carrier
Gateway 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.
- core
Network stringArn - The Amazon Resource Name (ARN) of the core network.
- destination
Cidr 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
. - destination
Ipv6Cidr stringBlock - The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destination
Prefix stringList Id - The ID of a prefix list used for the destination match.
- egress
Only stringInternet Gateway Id - [IPv6 traffic only] The ID of an egress-only internet gateway.
- gateway
Id string - The ID of an internet gateway or virtual private gateway attached to your VPC.
- instance
Id 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.
- local
Gateway stringId - The ID of the local gateway.
- nat
Gateway stringId - [IPv4 traffic only] The ID of a NAT gateway.
- network
Interface stringId - The ID of a network interface.
- transit
Gateway stringId - The ID of a transit gateway.
- vpc
Endpoint stringId - The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpc
Peering 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.
- route
Table StringId - The ID of the route table for the route.
- carrier
Gateway 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.
- core
Network StringArn - The Amazon Resource Name (ARN) of the core network.
- destination
Cidr 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
. - destination
Ipv6Cidr StringBlock - The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
- destination
Prefix StringList Id - The ID of a prefix list used for the destination match.
- egress
Only StringInternet Gateway Id - [IPv6 traffic only] The ID of an egress-only internet gateway.
- gateway
Id String - The ID of an internet gateway or virtual private gateway attached to your VPC.
- instance
Id 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.
- local
Gateway StringId - The ID of the local gateway.
- nat
Gateway StringId - [IPv4 traffic only] The ID of a NAT gateway.
- network
Interface StringId - The ID of a network interface.
- transit
Gateway StringId - The ID of a transit gateway.
- vpc
Endpoint StringId - The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
- vpc
Peering 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.