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);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:
- Destination
Cidr stringBlock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Transit
Gateway stringRoute Table Id Identifier of EC2 Transit Gateway Route Table.
- Blackhole bool
Indicates whether to drop traffic that matches this route (default to
false).- Transit
Gateway stringAttachment Id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).
- Destination
Cidr stringBlock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Transit
Gateway stringRoute Table Id Identifier of EC2 Transit Gateway Route Table.
- Blackhole bool
Indicates whether to drop traffic that matches this route (default to
false).- Transit
Gateway stringAttachment Id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).
- destination
Cidr stringBlock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- transit
Gateway stringRoute Table Id Identifier of EC2 Transit Gateway Route Table.
- blackhole boolean
Indicates whether to drop traffic that matches this route (default to
false).- transit
Gateway stringAttachment Id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).
- destination_
cidr_ strblock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- transit_
gateway_ strroute_ table_ id Identifier of EC2 Transit Gateway Route Table.
- blackhole bool
Indicates whether to drop traffic that matches this route (default to
false).- transit_
gateway_ strattachment_ id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).
Outputs
All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:
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): Routestatic 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).- Destination
Cidr stringBlock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Transit
Gateway stringAttachment Id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).- Transit
Gateway stringRoute Table Id Identifier of EC2 Transit Gateway Route Table.
- Blackhole bool
Indicates whether to drop traffic that matches this route (default to
false).- Destination
Cidr stringBlock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- Transit
Gateway stringAttachment Id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).- Transit
Gateway stringRoute Table Id Identifier of EC2 Transit Gateway Route Table.
- blackhole boolean
Indicates whether to drop traffic that matches this route (default to
false).- destination
Cidr stringBlock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- transit
Gateway stringAttachment Id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).- transit
Gateway stringRoute Table Id Identifier of EC2 Transit Gateway Route Table.
- blackhole bool
Indicates whether to drop traffic that matches this route (default to
false).- destination_
cidr_ strblock IPv4 CIDR range used for destination matches. Routing decisions are based on the most specific match.
- transit_
gateway_ strattachment_ id Identifier of EC2 Transit Gateway Attachment (required if
blackholeis set to false).- transit_
gateway_ strroute_ table_ id 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
awsTerraform Provider.