Class Route
Provides a resource to create a routing table entry (a route) in a VPC routing table.
NOTE on Route Tables and Routes: This provider currently provides both a standalone Route resource and a Route Table resource with routes defined in-line. At this time you cannot use a Route Table with in-line routes in conjunction with any Route resources. Doing so will cause a conflict of rule settings and will overwrite rules.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var route = new Aws.Ec2.Route("route", new Aws.Ec2.RouteArgs
{
RouteTableId = "rtb-4fbb3ac4",
DestinationCidrBlock = "10.0.1.0/22",
VpcPeeringConnectionId = "pcx-45ff3dc1",
});
}
}
Example IPv6 Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var vpc = new Aws.Ec2.Vpc("vpc", new Aws.Ec2.VpcArgs
{
AssignGeneratedIpv6CidrBlock = true,
CidrBlock = "10.1.0.0/16",
});
var egress = new Aws.Ec2.EgressOnlyInternetGateway("egress", new Aws.Ec2.EgressOnlyInternetGatewayArgs
{
VpcId = vpc.Id,
});
var route = new Aws.Ec2.Route("route", new Aws.Ec2.RouteArgs
{
DestinationIpv6CidrBlock = "::/0",
EgressOnlyGatewayId = egress.Id,
RouteTableId = "rtb-4fbb3ac4",
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class Route : CustomResource
Constructors
View SourceRoute(String, RouteArgs, CustomResourceOptions)
Create a Route resource with the given unique name, arguments, and options.
Declaration
public Route(string name, RouteArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RouteArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDestinationCidrBlock
The destination CIDR block.
Declaration
public Output<string> DestinationCidrBlock { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DestinationIpv6CidrBlock
The destination IPv6 CIDR block.
Declaration
public Output<string> DestinationIpv6CidrBlock { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DestinationPrefixListId
Declaration
public Output<string> DestinationPrefixListId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EgressOnlyGatewayId
Identifier of a VPC Egress Only Internet Gateway.
Declaration
public Output<string> EgressOnlyGatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
GatewayId
Identifier of a VPC internet gateway or a virtual private gateway.
Declaration
public Output<string> GatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceId
Identifier of an EC2 instance.
Declaration
public Output<string> InstanceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
InstanceOwnerId
Declaration
public Output<string> InstanceOwnerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NatGatewayId
Identifier of a VPC NAT gateway.
Declaration
public Output<string> NatGatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkInterfaceId
Identifier of an EC2 network interface.
Declaration
public Output<string> NetworkInterfaceId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Origin
Declaration
public Output<string> Origin { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RouteTableId
The ID of the routing table.
Declaration
public Output<string> RouteTableId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
State
Declaration
public Output<string> State { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TransitGatewayId
Identifier of an EC2 Transit Gateway.
Declaration
public Output<string> TransitGatewayId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcPeeringConnectionId
Identifier of a VPC peering connection.
Declaration
public Output<string> VpcPeeringConnectionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, RouteState, CustomResourceOptions)
Get an existing Route resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Route Get(string name, Input<string> id, RouteState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| RouteState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Route |