Class RouteTable
Provides a resource to create 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.
NOTE on
gateway_idandnat_gateway_id: The AWS API is very forgiving with these two attributes and theaws.ec2.RouteTableresource can be created with a NAT ID specified as a Gateway ID attribute. This will lead to a permanent diff between your configuration and statefile, as the API returns the correct parameters in the returned route table. If you're experiencing constant diffs in youraws.ec2.RouteTableresources, the first thing to check is whether or not you're specifying a NAT ID instead of a Gateway ID, or vice-versa.
NOTE on
propagating_vgwsand theaws.ec2.VpnGatewayRoutePropagationresource: If thepropagating_vgwsargument is present, it's not supported to also define route propagations usingaws.ec2.VpnGatewayRoutePropagation, since this resource will delete any propagating gateways not explicitly listed inpropagating_vgws. Omit this argument when defining route propagation using the separate resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var routeTable = new Aws.Ec2.RouteTable("routeTable", new Aws.Ec2.RouteTableArgs
{
Routes =
{
new Aws.Ec2.Inputs.RouteTableRouteArgs
{
CidrBlock = "10.0.1.0/24",
GatewayId = aws_internet_gateway.Main.Id,
},
new Aws.Ec2.Inputs.RouteTableRouteArgs
{
EgressOnlyGatewayId = aws_egress_only_internet_gateway.Foo.Id,
Ipv6CidrBlock = "::/0",
},
},
Tags =
{
{ "Name", "main" },
},
VpcId = aws_vpc.Default.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class RouteTable : CustomResource
Constructors
View SourceRouteTable(String, RouteTableArgs, CustomResourceOptions)
Create a RouteTable resource with the given unique name, arguments, and options.
Declaration
public RouteTable(string name, RouteTableArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| RouteTableArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceOwnerId
The ID of the AWS account that owns the route table.
Declaration
public Output<string> OwnerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PropagatingVgws
A list of virtual gateways for propagation.
Declaration
public Output<ImmutableArray<string>> PropagatingVgws { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Routes
A list of route objects. Their keys are documented below.
Declaration
public Output<ImmutableArray<RouteTableRoute>> Routes { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<RouteTableRoute>> |
Tags
A mapping of tags to assign to the resource.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
VpcId
The VPC ID.
Declaration
public Output<string> VpcId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, RouteTableState, CustomResourceOptions)
Get an existing RouteTable resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static RouteTable Get(string name, Input<string> id, RouteTableState 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. |
| RouteTableState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| RouteTable |