Class GetRoute
Inheritance
System.Object
GetRoute
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public static class GetRoute
Methods
View SourceInvokeAsync(GetRouteArgs, InvokeOptions)
aws.ec2.Route provides details about a specific Route.
This resource can prove useful when finding the resource associated with a CIDR. For example, finding the peering connection associated with a CIDR value.
{{% examples %}}
Example Usage
{{% example %}}
The following example shows how one might use a CIDR value to find a network interface id and use this to create a data source of that network interface.
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var subnetId = config.RequireObject<dynamic>("subnetId");
var selected = Output.Create(Aws.Ec2.GetRouteTable.InvokeAsync(new Aws.Ec2.GetRouteTableArgs
{
SubnetId = subnetId,
}));
var route = Output.Create(Aws.Ec2.GetRoute.InvokeAsync(new Aws.Ec2.GetRouteArgs
{
DestinationCidrBlock = "10.0.1.0/24",
RouteTableId = aws_route_table.Selected.Id,
}));
var @interface = Output.Create(Aws.Ec2.GetNetworkInterface.InvokeAsync(new Aws.Ec2.GetNetworkInterfaceArgs
{
NetworkInterfaceId = route.Apply(route => route.NetworkInterfaceId),
}));
}
}
{{% /example %}} {{% /examples %}}
Declaration
public static Task<GetRouteResult> InvokeAsync(GetRouteArgs args, InvokeOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GetRouteArgs | args | |
| InvokeOptions | options |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<GetRouteResult> |