Route

Manages an EC2 Transit Gateway Route.

Example Usage

Standard usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Ec2TransitGateway.Route("example", new Aws.Ec2TransitGateway.RouteArgs
        {
            DestinationCidrBlock = "0.0.0.0/0",
            TransitGatewayAttachmentId = aws_ec2_transit_gateway_vpc_attachment.Example.Id,
            TransitGatewayRouteTableId = aws_ec2_transit_gateway.Example.Association_default_route_table_id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2transitgateway"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2transitgateway.NewRoute(ctx, "example", &ec2transitgateway.RouteArgs{
            DestinationCidrBlock:       pulumi.String("0.0.0.0/0"),
            TransitGatewayAttachmentId: pulumi.String(aws_ec2_transit_gateway_vpc_attachment.Example.Id),
            TransitGatewayRouteTableId: pulumi.String(aws_ec2_transit_gateway.Example.Association_default_route_table_id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.Route("example",
    destination_cidr_block="0.0.0.0/0",
    transit_gateway_attachment_id=aws_ec2_transit_gateway_vpc_attachment["example"]["id"],
    transit_gateway_route_table_id=aws_ec2_transit_gateway["example"]["association_default_route_table_id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ec2transitgateway.Route("example", {
    destinationCidrBlock: "0.0.0.0/0",
    transitGatewayAttachmentId: aws_ec2_transit_gateway_vpc_attachment_example.id,
    transitGatewayRouteTableId: aws_ec2_transit_gateway_example.associationDefaultRouteTableId,
});

Blackhole route

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.Ec2TransitGateway.Route("example", new Aws.Ec2TransitGateway.RouteArgs
        {
            Blackhole = true,
            DestinationCidrBlock = "0.0.0.0/0",
            TransitGatewayRouteTableId = aws_ec2_transit_gateway.Example.Association_default_route_table_id,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2transitgateway"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := ec2transitgateway.NewRoute(ctx, "example", &ec2transitgateway.RouteArgs{
            Blackhole:                  pulumi.Bool(true),
            DestinationCidrBlock:       pulumi.String("0.0.0.0/0"),
            TransitGatewayRouteTableId: pulumi.String(aws_ec2_transit_gateway.Example.Association_default_route_table_id),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

example = aws.ec2transitgateway.Route("example",
    blackhole=True,
    destination_cidr_block="0.0.0.0/0",
    transit_gateway_route_table_id=aws_ec2_transit_gateway["example"]["association_default_route_table_id"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.ec2transitgateway.Route("example", {
    blackhole: true,
    destinationCidrBlock: "0.0.0.0/0",
    transitGatewayRouteTableId: aws_ec2_transit_gateway_example.associationDefaultRouteTableId,
});

Create a Route Resource

new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
def Route(resource_name, opts=None, blackhole=None, destination_cidr_block=None, transit_gateway_attachment_id=None, transit_gateway_route_table_id=None, __props__=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.
opts ResourceOptions
A bag of options that control this 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:

DestinationCidrBlock string

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

TransitGatewayRouteTableId string

Identifier of EC2 Transit Gateway Route Table.

Blackhole bool

Indicates whether to drop traffic that matches this route (default to false).

TransitGatewayAttachmentId string

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

DestinationCidrBlock string

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

TransitGatewayRouteTableId string

Identifier of EC2 Transit Gateway Route Table.

Blackhole bool

Indicates whether to drop traffic that matches this route (default to false).

TransitGatewayAttachmentId string

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

destinationCidrBlock string

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

transitGatewayRouteTableId string

Identifier of EC2 Transit Gateway Route Table.

blackhole boolean

Indicates whether to drop traffic that matches this route (default to false).

transitGatewayAttachmentId string

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

destination_cidr_block str

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

transit_gateway_route_table_id str

Identifier of EC2 Transit Gateway Route Table.

blackhole bool

Indicates whether to drop traffic that matches this route (default to false).

transit_gateway_attachment_id str

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

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.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

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
static get(resource_name, id, opts=None, blackhole=None, destination_cidr_block=None, transit_gateway_attachment_id=None, transit_gateway_route_table_id=None, __props__=None);
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:

Blackhole bool

Indicates whether to drop traffic that matches this route (default to false).

DestinationCidrBlock string

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

TransitGatewayAttachmentId string

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

TransitGatewayRouteTableId string

Identifier of EC2 Transit Gateway Route Table.

Blackhole bool

Indicates whether to drop traffic that matches this route (default to false).

DestinationCidrBlock string

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

TransitGatewayAttachmentId string

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

TransitGatewayRouteTableId string

Identifier of EC2 Transit Gateway Route Table.

blackhole boolean

Indicates whether to drop traffic that matches this route (default to false).

destinationCidrBlock string

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

transitGatewayAttachmentId string

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

transitGatewayRouteTableId string

Identifier of EC2 Transit Gateway Route Table.

blackhole bool

Indicates whether to drop traffic that matches this route (default to false).

destination_cidr_block str

IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.

transit_gateway_attachment_id str

Identifier of EC2 Transit Gateway Attachment (required if blackhole is set to false).

transit_gateway_route_table_id str

Identifier of EC2 Transit Gateway Route Table.

Package Details

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