Route

Import

Individual routes can be imported using ROUTETABLEID_DESTINATION. For example, import a route in route table rtb-656C65616E6F72 with an IPv4 destination CIDR of 10.42.0.0/16 like thisconsole

 $ pulumi import aws:ec2/route:Route my_route rtb-656C65616E6F72_10.42.0.0/16

Import a route in route table rtb-656C65616E6F72 with an IPv6 destination CIDR of 2620:0:2d0:200::8/125 similarlyconsole

 $ pulumi import aws:ec2/route:Route my_route rtb-656C65616E6F72_2620:0:2d0:200::8/125

Import a route in route table rtb-656C65616E6F72 with a managed prefix list destination of pl-0570a1d2d725c16be similarlyconsole

 $ pulumi import aws:ec2/route:Route my_route rtb-656C65616E6F72_pl-0570a1d2d725c16be

Create a Route Resource

new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
@overload
def Route(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          carrier_gateway_id: Optional[str] = None,
          destination_cidr_block: Optional[str] = None,
          destination_ipv6_cidr_block: Optional[str] = None,
          destination_prefix_list_id: Optional[str] = None,
          egress_only_gateway_id: Optional[str] = None,
          gateway_id: Optional[str] = None,
          instance_id: Optional[str] = None,
          local_gateway_id: Optional[str] = None,
          nat_gateway_id: Optional[str] = None,
          network_interface_id: Optional[str] = None,
          route_table_id: Optional[str] = None,
          transit_gateway_id: Optional[str] = None,
          vpc_endpoint_id: Optional[str] = None,
          vpc_peering_connection_id: Optional[str] = None)
@overload
def Route(resource_name: str,
          args: RouteArgs,
          opts: Optional[ResourceOptions] = None)
func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
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.

Route Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Route resource accepts the following input properties:

RouteTableId string
The ID of the routing table.
CarrierGatewayId string
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
DestinationCidrBlock string
The destination CIDR block.
DestinationIpv6CidrBlock string
The destination IPv6 CIDR block.
DestinationPrefixListId string
The ID of a managed prefix list destination.
EgressOnlyGatewayId string
Identifier of a VPC Egress Only Internet Gateway.
GatewayId string
Identifier of a VPC internet gateway or a virtual private gateway.
InstanceId string
Identifier of an EC2 instance.
LocalGatewayId string
Identifier of a Outpost local gateway.
NatGatewayId string
Identifier of a VPC NAT gateway.
NetworkInterfaceId string
Identifier of an EC2 network interface.
TransitGatewayId string
Identifier of an EC2 Transit Gateway.
VpcEndpointId string
Identifier of a VPC Endpoint.
VpcPeeringConnectionId string
Identifier of a VPC peering connection.
RouteTableId string
The ID of the routing table.
CarrierGatewayId string
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
DestinationCidrBlock string
The destination CIDR block.
DestinationIpv6CidrBlock string
The destination IPv6 CIDR block.
DestinationPrefixListId string
The ID of a managed prefix list destination.
EgressOnlyGatewayId string
Identifier of a VPC Egress Only Internet Gateway.
GatewayId string
Identifier of a VPC internet gateway or a virtual private gateway.
InstanceId string
Identifier of an EC2 instance.
LocalGatewayId string
Identifier of a Outpost local gateway.
NatGatewayId string
Identifier of a VPC NAT gateway.
NetworkInterfaceId string
Identifier of an EC2 network interface.
TransitGatewayId string
Identifier of an EC2 Transit Gateway.
VpcEndpointId string
Identifier of a VPC Endpoint.
VpcPeeringConnectionId string
Identifier of a VPC peering connection.
routeTableId string
The ID of the routing table.
carrierGatewayId string
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
destinationCidrBlock string
The destination CIDR block.
destinationIpv6CidrBlock string
The destination IPv6 CIDR block.
destinationPrefixListId string
The ID of a managed prefix list destination.
egressOnlyGatewayId string
Identifier of a VPC Egress Only Internet Gateway.
gatewayId string
Identifier of a VPC internet gateway or a virtual private gateway.
instanceId string
Identifier of an EC2 instance.
localGatewayId string
Identifier of a Outpost local gateway.
natGatewayId string
Identifier of a VPC NAT gateway.
networkInterfaceId string
Identifier of an EC2 network interface.
transitGatewayId string
Identifier of an EC2 Transit Gateway.
vpcEndpointId string
Identifier of a VPC Endpoint.
vpcPeeringConnectionId string
Identifier of a VPC peering connection.
route_table_id str
The ID of the routing table.
carrier_gateway_id str
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
destination_cidr_block str
The destination CIDR block.
destination_ipv6_cidr_block str
The destination IPv6 CIDR block.
destination_prefix_list_id str
The ID of a managed prefix list destination.
egress_only_gateway_id str
Identifier of a VPC Egress Only Internet Gateway.
gateway_id str
Identifier of a VPC internet gateway or a virtual private gateway.
instance_id str
Identifier of an EC2 instance.
local_gateway_id str
Identifier of a Outpost local gateway.
nat_gateway_id str
Identifier of a VPC NAT gateway.
network_interface_id str
Identifier of an EC2 network interface.
transit_gateway_id str
Identifier of an EC2 Transit Gateway.
vpc_endpoint_id str
Identifier of a VPC Endpoint.
vpc_peering_connection_id str
Identifier of a VPC peering connection.

Outputs

All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
InstanceOwnerId string
The AWS account ID of the owner of the EC2 instance.
Origin string
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
State string
The state of the route - active or blackhole.
Id string
The provider-assigned unique ID for this managed resource.
InstanceOwnerId string
The AWS account ID of the owner of the EC2 instance.
Origin string
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
State string
The state of the route - active or blackhole.
id string
The provider-assigned unique ID for this managed resource.
instanceOwnerId string
The AWS account ID of the owner of the EC2 instance.
origin string
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
state string
The state of the route - active or blackhole.
id str
The provider-assigned unique ID for this managed resource.
instance_owner_id str
The AWS account ID of the owner of the EC2 instance.
origin str
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
state str
The state of the route - active or blackhole.

Look up an Existing Route Resource

Get an existing Route resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: RouteState, opts?: CustomResourceOptions): Route
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        carrier_gateway_id: Optional[str] = None,
        destination_cidr_block: Optional[str] = None,
        destination_ipv6_cidr_block: Optional[str] = None,
        destination_prefix_list_id: Optional[str] = None,
        egress_only_gateway_id: Optional[str] = None,
        gateway_id: Optional[str] = None,
        instance_id: Optional[str] = None,
        instance_owner_id: Optional[str] = None,
        local_gateway_id: Optional[str] = None,
        nat_gateway_id: Optional[str] = None,
        network_interface_id: Optional[str] = None,
        origin: Optional[str] = None,
        route_table_id: Optional[str] = None,
        state: Optional[str] = None,
        transit_gateway_id: Optional[str] = None,
        vpc_endpoint_id: Optional[str] = None,
        vpc_peering_connection_id: Optional[str] = None) -> Route
func GetRoute(ctx *Context, name string, id IDInput, state *RouteState, opts ...ResourceOption) (*Route, error)
public static Route Get(string name, Input<string> id, RouteState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

CarrierGatewayId string
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
DestinationCidrBlock string
The destination CIDR block.
DestinationIpv6CidrBlock string
The destination IPv6 CIDR block.
DestinationPrefixListId string
The ID of a managed prefix list destination.
EgressOnlyGatewayId string
Identifier of a VPC Egress Only Internet Gateway.
GatewayId string
Identifier of a VPC internet gateway or a virtual private gateway.
InstanceId string
Identifier of an EC2 instance.
InstanceOwnerId string
The AWS account ID of the owner of the EC2 instance.
LocalGatewayId string
Identifier of a Outpost local gateway.
NatGatewayId string
Identifier of a VPC NAT gateway.
NetworkInterfaceId string
Identifier of an EC2 network interface.
Origin string
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
RouteTableId string
The ID of the routing table.
State string
The state of the route - active or blackhole.
TransitGatewayId string
Identifier of an EC2 Transit Gateway.
VpcEndpointId string
Identifier of a VPC Endpoint.
VpcPeeringConnectionId string
Identifier of a VPC peering connection.
CarrierGatewayId string
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
DestinationCidrBlock string
The destination CIDR block.
DestinationIpv6CidrBlock string
The destination IPv6 CIDR block.
DestinationPrefixListId string
The ID of a managed prefix list destination.
EgressOnlyGatewayId string
Identifier of a VPC Egress Only Internet Gateway.
GatewayId string
Identifier of a VPC internet gateway or a virtual private gateway.
InstanceId string
Identifier of an EC2 instance.
InstanceOwnerId string
The AWS account ID of the owner of the EC2 instance.
LocalGatewayId string
Identifier of a Outpost local gateway.
NatGatewayId string
Identifier of a VPC NAT gateway.
NetworkInterfaceId string
Identifier of an EC2 network interface.
Origin string
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
RouteTableId string
The ID of the routing table.
State string
The state of the route - active or blackhole.
TransitGatewayId string
Identifier of an EC2 Transit Gateway.
VpcEndpointId string
Identifier of a VPC Endpoint.
VpcPeeringConnectionId string
Identifier of a VPC peering connection.
carrierGatewayId string
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
destinationCidrBlock string
The destination CIDR block.
destinationIpv6CidrBlock string
The destination IPv6 CIDR block.
destinationPrefixListId string
The ID of a managed prefix list destination.
egressOnlyGatewayId string
Identifier of a VPC Egress Only Internet Gateway.
gatewayId string
Identifier of a VPC internet gateway or a virtual private gateway.
instanceId string
Identifier of an EC2 instance.
instanceOwnerId string
The AWS account ID of the owner of the EC2 instance.
localGatewayId string
Identifier of a Outpost local gateway.
natGatewayId string
Identifier of a VPC NAT gateway.
networkInterfaceId string
Identifier of an EC2 network interface.
origin string
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
routeTableId string
The ID of the routing table.
state string
The state of the route - active or blackhole.
transitGatewayId string
Identifier of an EC2 Transit Gateway.
vpcEndpointId string
Identifier of a VPC Endpoint.
vpcPeeringConnectionId string
Identifier of a VPC peering connection.
carrier_gateway_id str
Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone.
destination_cidr_block str
The destination CIDR block.
destination_ipv6_cidr_block str
The destination IPv6 CIDR block.
destination_prefix_list_id str
The ID of a managed prefix list destination.
egress_only_gateway_id str
Identifier of a VPC Egress Only Internet Gateway.
gateway_id str
Identifier of a VPC internet gateway or a virtual private gateway.
instance_id str
Identifier of an EC2 instance.
instance_owner_id str
The AWS account ID of the owner of the EC2 instance.
local_gateway_id str
Identifier of a Outpost local gateway.
nat_gateway_id str
Identifier of a VPC NAT gateway.
network_interface_id str
Identifier of an EC2 network interface.
origin str
How the route was created - CreateRouteTable, CreateRoute or EnableVgwRoutePropagation.
route_table_id str
The ID of the routing table.
state str
The state of the route - active or blackhole.
transit_gateway_id str
Identifier of an EC2 Transit Gateway.
vpc_endpoint_id str
Identifier of a VPC Endpoint.
vpc_peering_connection_id str
Identifier of a VPC peering connection.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.