We recommend new projects start with resources from the AWS provider.
aws-native.ec2.getRoute
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.
Using getRoute
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRoute(args: GetRouteArgs, opts?: InvokeOptions): Promise<GetRouteResult>
function getRouteOutput(args: GetRouteOutputArgs, opts?: InvokeOptions): Output<GetRouteResult>def get_route(cidr_block: Optional[str] = None,
              route_table_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetRouteResult
def get_route_output(cidr_block: Optional[pulumi.Input[str]] = None,
              route_table_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetRouteResult]func LookupRoute(ctx *Context, args *LookupRouteArgs, opts ...InvokeOption) (*LookupRouteResult, error)
func LookupRouteOutput(ctx *Context, args *LookupRouteOutputArgs, opts ...InvokeOption) LookupRouteResultOutput> Note: This function is named LookupRoute in the Go SDK.
public static class GetRoute 
{
    public static Task<GetRouteResult> InvokeAsync(GetRouteArgs args, InvokeOptions? opts = null)
    public static Output<GetRouteResult> Invoke(GetRouteInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRouteResult> getRoute(GetRouteArgs args, InvokeOptions options)
public static Output<GetRouteResult> getRoute(GetRouteArgs args, InvokeOptions options)
fn::invoke:
  function: aws-native:ec2:getRoute
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CidrBlock string
- The IPv4 CIDR block.
- RouteTable stringId 
- The ID of the route table for the route.
- CidrBlock string
- The IPv4 CIDR block.
- RouteTable stringId 
- The ID of the route table for the route.
- cidrBlock String
- The IPv4 CIDR block.
- routeTable StringId 
- The ID of the route table for the route.
- cidrBlock string
- The IPv4 CIDR block.
- routeTable stringId 
- The ID of the route table for the route.
- cidr_block str
- The IPv4 CIDR block.
- route_table_ strid 
- The ID of the route table for the route.
- cidrBlock String
- The IPv4 CIDR block.
- routeTable StringId 
- The ID of the route table for the route.
getRoute Result
The following output properties are available:
- 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.
- CidrBlock string
- The IPv4 CIDR block.
- CoreNetwork stringArn 
- The Amazon Resource Name (ARN) of the core network.
- 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.
- 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.
- CidrBlock string
- The IPv4 CIDR block.
- CoreNetwork stringArn 
- The Amazon Resource Name (ARN) of the core network.
- 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.
- 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.
- cidrBlock String
- The IPv4 CIDR block.
- coreNetwork StringArn 
- The Amazon Resource Name (ARN) of the core network.
- 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.
- 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.
- cidrBlock string
- The IPv4 CIDR block.
- coreNetwork stringArn 
- The Amazon Resource Name (ARN) of the core network.
- 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.
- 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.
- cidr_block str
- The IPv4 CIDR block.
- core_network_ strarn 
- The Amazon Resource Name (ARN) of the core network.
- 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.
- 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.
- cidrBlock String
- The IPv4 CIDR block.
- coreNetwork StringArn 
- The Amazon Resource Name (ARN) of the core network.
- 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.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.