Skip to content

aws.ec2-route resource

Description

Route is one route in a route table. It matches a destination -- an IPv4 or IPv6 CIDR block, or a prefix list -- to exactly one target, such as a gateway, NAT gateway, network interface, or peering connection. There is no route id; a route is addressed forever by its table and its destination, both fixed at create. Each field maps to the AWS SDK field that holds it on CreateRoute and ReplaceRoute.

Source: internal/service/ec2/route_rsrc.go:29

Example usage:

imports: {
  aws: 'github.com/cloudboss/unobin-library-aws'
}

resources: {
  example: aws.ec2-route {
    # Set input fields here.
  }
}

Inputs

route-table-id

string

required

destination-cidr-block

optional(string)

destination-ipv6-cidr-block

optional(string)

destination-prefix-list-id

optional(string)

carrier-gateway-id

optional(string)

core-network-arn

optional(string)

egress-only-gateway-id

optional(string)

gateway-id

optional(string)

local-gateway-id

optional(string)

nat-gateway-id

optional(string)

network-interface-id

optional(string)

transit-gateway-id

optional(string)

vpc-endpoint-id

optional(string)

vpc-peering-connection-id

optional(string)

Input Constraints

Field combinations

Exactly one of destination-cidr-block, destination-ipv6-cidr-block, or destination-prefix-list-id.

Exactly one of carrier-gateway-id, core-network-arn, egress-only-gateway-id, gateway-id, local-gateway-id, nat-gateway-id, network-interface-id, transit-gateway-id, vpc-endpoint-id, or vpc-peering-connection-id.

Forbidden together: carrier-gateway-id and destination-ipv6-cidr-block.

Forbidden together: egress-only-gateway-id and destination-cidr-block.

Forbidden together: vpc-endpoint-id and destination-prefix-list-id.

Gateway id rules

gateway-id cannot be local; the local route is not managed here.

Rule logic
When
input.gateway-id != null
Require
input.gateway-id != 'local'

Outputs

state

string