1. Packages
  2. AWS Native
  3. API Docs
  4. ec2
  5. Route

We recommend new projects start with resources from the AWS provider.

AWS Native v0.126.0 published on Monday, Sep 30, 2024 by Pulumi

aws-native.ec2.Route

Explore with Pulumi AI

aws-native logo

We recommend new projects start with resources from the AWS provider.

AWS Native v0.126.0 published on Monday, Sep 30, 2024 by Pulumi

    Specifies a route in a route table. For more information, see Routes in the Amazon VPC User Guide. You must specify either a destination CIDR block or prefix list ID. You must also specify exactly one of the resources as the target. If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a DependsOn Attribute in the AWS::EC2::Route resource to explicitly declare a dependency on the AWS::EC2::TransitGatewayAttachment resource.

    Create Route Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Route(name: string, args: RouteArgs, opts?: CustomResourceOptions);
    @overload
    def Route(resource_name: str,
              args: RouteArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Route(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              route_table_id: Optional[str] = None,
              gateway_id: Optional[str] = None,
              local_gateway_id: Optional[str] = None,
              destination_ipv6_cidr_block: Optional[str] = None,
              destination_prefix_list_id: Optional[str] = None,
              egress_only_internet_gateway_id: Optional[str] = None,
              carrier_gateway_id: Optional[str] = None,
              instance_id: Optional[str] = None,
              destination_cidr_block: Optional[str] = None,
              nat_gateway_id: Optional[str] = None,
              network_interface_id: Optional[str] = None,
              core_network_arn: Optional[str] = None,
              transit_gateway_id: Optional[str] = None,
              vpc_endpoint_id: Optional[str] = None,
              vpc_peering_connection_id: Optional[str] = None)
    func NewRoute(ctx *Context, name string, args RouteArgs, opts ...ResourceOption) (*Route, error)
    public Route(string name, RouteArgs args, CustomResourceOptions? opts = null)
    public Route(String name, RouteArgs args)
    public Route(String name, RouteArgs args, CustomResourceOptions options)
    
    type: aws-native:ec2:Route
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    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.
    args RouteArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control 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.
    name String
    The unique name of the resource.
    args RouteArgs
    The arguments to resource properties.
    options 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 Architecture and Concepts docs.

    Inputs

    The Route resource accepts the following input properties:

    RouteTableId string
    The ID of the route table for the route.
    CarrierGatewayId string
    The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
    CoreNetworkArn string
    The Amazon Resource Name (ARN) of the core network.
    DestinationCidrBlock string
    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
    DestinationIpv6CidrBlock string
    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
    DestinationPrefixListId string
    The ID of a prefix list used for the destination match.
    EgressOnlyInternetGatewayId string
    [IPv6 traffic only] The ID of an egress-only internet gateway.
    GatewayId string
    The ID of an internet gateway or virtual private gateway attached to your VPC.
    InstanceId string
    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    LocalGatewayId string
    The ID of the local gateway.
    NatGatewayId string
    [IPv4 traffic only] The ID of a NAT gateway.
    NetworkInterfaceId string
    The ID of a network interface.
    TransitGatewayId string
    The ID of a transit gateway.
    VpcEndpointId string
    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
    VpcPeeringConnectionId string
    The ID of a VPC peering connection.
    RouteTableId string
    The ID of the route table for the route.
    CarrierGatewayId string
    The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
    CoreNetworkArn string
    The Amazon Resource Name (ARN) of the core network.
    DestinationCidrBlock string
    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
    DestinationIpv6CidrBlock string
    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
    DestinationPrefixListId string
    The ID of a prefix list used for the destination match.
    EgressOnlyInternetGatewayId string
    [IPv6 traffic only] The ID of an egress-only internet gateway.
    GatewayId string
    The ID of an internet gateway or virtual private gateway attached to your VPC.
    InstanceId string
    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    LocalGatewayId string
    The ID of the local gateway.
    NatGatewayId string
    [IPv4 traffic only] The ID of a NAT gateway.
    NetworkInterfaceId string
    The ID of a network interface.
    TransitGatewayId string
    The ID of a transit gateway.
    VpcEndpointId string
    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
    VpcPeeringConnectionId string
    The ID of a VPC peering connection.
    routeTableId String
    The ID of the route table for the route.
    carrierGatewayId String
    The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
    coreNetworkArn String
    The Amazon Resource Name (ARN) of the core network.
    destinationCidrBlock String
    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
    destinationIpv6CidrBlock String
    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
    destinationPrefixListId String
    The ID of a prefix list used for the destination match.
    egressOnlyInternetGatewayId String
    [IPv6 traffic only] The ID of an egress-only internet gateway.
    gatewayId String
    The ID of an internet gateway or virtual private gateway attached to your VPC.
    instanceId String
    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    localGatewayId String
    The ID of the local gateway.
    natGatewayId String
    [IPv4 traffic only] The ID of a NAT gateway.
    networkInterfaceId String
    The ID of a network interface.
    transitGatewayId String
    The ID of a transit gateway.
    vpcEndpointId String
    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
    vpcPeeringConnectionId String
    The ID of a VPC peering connection.
    routeTableId string
    The ID of the route table for the route.
    carrierGatewayId string
    The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
    coreNetworkArn string
    The Amazon Resource Name (ARN) of the core network.
    destinationCidrBlock string
    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
    destinationIpv6CidrBlock string
    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
    destinationPrefixListId string
    The ID of a prefix list used for the destination match.
    egressOnlyInternetGatewayId string
    [IPv6 traffic only] The ID of an egress-only internet gateway.
    gatewayId string
    The ID of an internet gateway or virtual private gateway attached to your VPC.
    instanceId string
    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    localGatewayId string
    The ID of the local gateway.
    natGatewayId string
    [IPv4 traffic only] The ID of a NAT gateway.
    networkInterfaceId string
    The ID of a network interface.
    transitGatewayId string
    The ID of a transit gateway.
    vpcEndpointId string
    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
    vpcPeeringConnectionId string
    The ID of a VPC peering connection.
    route_table_id str
    The ID of the route table for the route.
    carrier_gateway_id str
    The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
    core_network_arn str
    The Amazon Resource Name (ARN) of the core network.
    destination_cidr_block str
    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
    destination_ipv6_cidr_block str
    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
    destination_prefix_list_id str
    The ID of a prefix list used for the destination match.
    egress_only_internet_gateway_id str
    [IPv6 traffic only] The ID of an egress-only internet gateway.
    gateway_id str
    The ID of an internet gateway or virtual private gateway attached to your VPC.
    instance_id str
    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    local_gateway_id str
    The ID of the local gateway.
    nat_gateway_id str
    [IPv4 traffic only] The ID of a NAT gateway.
    network_interface_id str
    The ID of a network interface.
    transit_gateway_id str
    The ID of a transit gateway.
    vpc_endpoint_id str
    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
    vpc_peering_connection_id str
    The ID of a VPC peering connection.
    routeTableId String
    The ID of the route table for the route.
    carrierGatewayId String
    The ID of the carrier gateway. You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.
    coreNetworkArn String
    The Amazon Resource Name (ARN) of the core network.
    destinationCidrBlock String
    The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.
    destinationIpv6CidrBlock String
    The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.
    destinationPrefixListId String
    The ID of a prefix list used for the destination match.
    egressOnlyInternetGatewayId String
    [IPv6 traffic only] The ID of an egress-only internet gateway.
    gatewayId String
    The ID of an internet gateway or virtual private gateway attached to your VPC.
    instanceId String
    The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.
    localGatewayId String
    The ID of the local gateway.
    natGatewayId String
    [IPv4 traffic only] The ID of a NAT gateway.
    networkInterfaceId String
    The ID of a network interface.
    transitGatewayId String
    The ID of a transit gateway.
    vpcEndpointId String
    The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.
    vpcPeeringConnectionId String
    The ID of a VPC peering connection.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Route resource produces the following output properties:

    CidrBlock string
    The IPv4 CIDR block.
    Id string
    The provider-assigned unique ID for this managed resource.
    CidrBlock string
    The IPv4 CIDR block.
    Id string
    The provider-assigned unique ID for this managed resource.
    cidrBlock String
    The IPv4 CIDR block.
    id String
    The provider-assigned unique ID for this managed resource.
    cidrBlock string
    The IPv4 CIDR block.
    id string
    The provider-assigned unique ID for this managed resource.
    cidr_block str
    The IPv4 CIDR block.
    id str
    The provider-assigned unique ID for this managed resource.
    cidrBlock String
    The IPv4 CIDR block.
    id String
    The provider-assigned unique ID for this managed resource.

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    We recommend new projects start with resources from the AWS provider.

    AWS Native v0.126.0 published on Monday, Sep 30, 2024 by Pulumi