Skip to content

Commit 4b84a65

Browse files
committed
fix: correct outputs in route-table module
1 parent 9edffcd commit 4b84a65

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

modules/route-table/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This module creates following resources.
2121

2222
| Name | Version |
2323
|------|---------|
24-
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.23.1 |
24+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.92.0 |
2525

2626
## Modules
2727

@@ -50,18 +50,18 @@ This module creates following resources.
5050
| <a name="input_name"></a> [name](#input\_name) | (Required) Desired name for the route table resources. | `string` | n/a | yes |
5151
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | (Required) The ID of the VPC which the route table belongs to. | `string` | n/a | yes |
5252
| <a name="input_gateways"></a> [gateways](#input\_gateways) | (Optional) A list of gateway IDs to associate with the route table. Only support Internet Gateway and Virtual Private Gateway. | `list(string)` | `[]` | no |
53-
| <a name="input_ipv4_routes"></a> [ipv4\_routes](#input\_ipv4\_routes) | (Optional) A list of route rules for destinations to IPv4 CIDRs. Each block of `ipv4_routes` as defined below.<br> (Required) `destination` - The destination IPv4 CIDR block of the route rule.<br> (Required) `target` - A configuration of the target of the route rule. `target` as defined below.<br> (Required) `type` - The type of the target of the route rule. Valid values are `CARRIER_GATEWAY`, `CORE_GATEWAY`, `EGRESS_ONLY_INTERNET_GATEWAY`, `INTERNET_GATEWAY`, `VPN_GATEWAY`, `LOCAL_GATEWAY`, `NAT_GATEWAY`, `NETWORK_INTERFACE`, `TRANSIT_GATEWAY`, `VPC_ENDPOINT`, `VPC_PEERING_CONNECTION`.<br> (Required) `id` - The ID of the target of the route rule. | <pre>list(object({<br> destination = string<br><br> target = object({<br> type = string<br> id = string<br> })<br> }))</pre> | `[]` | no |
54-
| <a name="input_ipv6_routes"></a> [ipv6\_routes](#input\_ipv6\_routes) | (Optional) A list of route rules for destinations to IPv6 CIDRs. Each block of `ipv6_routes` as defined below.<br> (Required) `destination` - The destination IPv6 CIDR block of the route rule.<br> (Required) `target` - A configuration of the target of the route rule. `target` as defined below.<br> (Required) `type` - The type of the target of the route rule. Valid values are `CARRIER_GATEWAY`, `CORE_GATEWAY`, `EGRESS_ONLY_INTERNET_GATEWAY`, `INTERNET_GATEWAY`, `VPN_GATEWAY`, `LOCAL_GATEWAY`, `NAT_GATEWAY`, `NETWORK_INTERFACE`, `TRANSIT_GATEWAY`, `VPC_ENDPOINT`, `VPC_PEERING_CONNECTION`.<br> (Required) `id` - The ID of the target of the route rule. | <pre>list(object({<br> destination = string<br><br> target = object({<br> type = string<br> id = string<br> })<br> }))</pre> | `[]` | no |
53+
| <a name="input_ipv4_routes"></a> [ipv4\_routes](#input\_ipv4\_routes) | (Optional) A list of route rules for destinations to IPv4 CIDRs. Each block of `ipv4_routes` as defined below.<br/> (Required) `destination` - The destination IPv4 CIDR block of the route rule.<br/> (Required) `target` - A configuration of the target of the route rule. `target` as defined below.<br/> (Required) `type` - The type of the target of the route rule. Valid values are `CARRIER_GATEWAY`, `CORE_GATEWAY`, `EGRESS_ONLY_INTERNET_GATEWAY`, `INTERNET_GATEWAY`, `VPN_GATEWAY`, `LOCAL_GATEWAY`, `NAT_GATEWAY`, `NETWORK_INTERFACE`, `TRANSIT_GATEWAY`, `VPC_ENDPOINT`, `VPC_PEERING_CONNECTION`.<br/> (Required) `id` - The ID of the target of the route rule. | <pre>list(object({<br/> destination = string<br/><br/> target = object({<br/> type = string<br/> id = string<br/> })<br/> }))</pre> | `[]` | no |
54+
| <a name="input_ipv6_routes"></a> [ipv6\_routes](#input\_ipv6\_routes) | (Optional) A list of route rules for destinations to IPv6 CIDRs. Each block of `ipv6_routes` as defined below.<br/> (Required) `destination` - The destination IPv6 CIDR block of the route rule.<br/> (Required) `target` - A configuration of the target of the route rule. `target` as defined below.<br/> (Required) `type` - The type of the target of the route rule. Valid values are `CARRIER_GATEWAY`, `CORE_GATEWAY`, `EGRESS_ONLY_INTERNET_GATEWAY`, `INTERNET_GATEWAY`, `VPN_GATEWAY`, `LOCAL_GATEWAY`, `NAT_GATEWAY`, `NETWORK_INTERFACE`, `TRANSIT_GATEWAY`, `VPC_ENDPOINT`, `VPC_PEERING_CONNECTION`.<br/> (Required) `id` - The ID of the target of the route rule. | <pre>list(object({<br/> destination = string<br/><br/> target = object({<br/> type = string<br/> id = string<br/> })<br/> }))</pre> | `[]` | no |
5555
| <a name="input_is_main"></a> [is\_main](#input\_is\_main) | (Optional) Whether to set this route table as the main route table. Defaults to `false`. | `bool` | `false` | no |
5656
| <a name="input_module_tags_enabled"></a> [module\_tags\_enabled](#input\_module\_tags\_enabled) | (Optional) Whether to create AWS Resource Tags for the module informations. | `bool` | `true` | no |
57-
| <a name="input_prefix_list_routes"></a> [prefix\_list\_routes](#input\_prefix\_list\_routes) | (Optional) A list of route rules for destinations to Prefix Lists. Each block of `prefix_list_routes` as defined below.<br> (Required) `name` - The name of the route rule.<br> (Required) `destination` - The destination Prefix List of the route rule.<br> (Required) `target` - A configuration of the target of the route rule. `target` as defined below.<br> (Required) `type` - The type of the target of the route rule. Valid values are `CARRIER_GATEWAY`, `CORE_GATEWAY`, `EGRESS_ONLY_INTERNET_GATEWAY`, `INTERNET_GATEWAY`, `VPN_GATEWAY`, `LOCAL_GATEWAY`, `NAT_GATEWAY`, `NETWORK_INTERFACE`, `TRANSIT_GATEWAY`, `VPC_ENDPOINT`, `VPC_PEERING_CONNECTION`.<br> (Required) `id` - The ID of the target of the route rule. | <pre>list(object({<br> name = string<br> destination = string<br><br> target = object({<br> type = string<br> id = string<br> })<br> }))</pre> | `[]` | no |
57+
| <a name="input_prefix_list_routes"></a> [prefix\_list\_routes](#input\_prefix\_list\_routes) | (Optional) A list of route rules for destinations to Prefix Lists. Each block of `prefix_list_routes` as defined below.<br/> (Required) `name` - The name of the route rule.<br/> (Required) `destination` - The destination Prefix List of the route rule.<br/> (Required) `target` - A configuration of the target of the route rule. `target` as defined below.<br/> (Required) `type` - The type of the target of the route rule. Valid values are `CARRIER_GATEWAY`, `CORE_GATEWAY`, `EGRESS_ONLY_INTERNET_GATEWAY`, `INTERNET_GATEWAY`, `VPN_GATEWAY`, `LOCAL_GATEWAY`, `NAT_GATEWAY`, `NETWORK_INTERFACE`, `TRANSIT_GATEWAY`, `VPC_ENDPOINT`, `VPC_PEERING_CONNECTION`.<br/> (Required) `id` - The ID of the target of the route rule. | <pre>list(object({<br/> name = string<br/> destination = string<br/><br/> target = object({<br/> type = string<br/> id = string<br/> })<br/> }))</pre> | `[]` | no |
5858
| <a name="input_propagating_vpn_gateways"></a> [propagating\_vpn\_gateways](#input\_propagating\_vpn\_gateways) | (Optional) A list of Virtual Private Gateway IDs to propagate routes from. | `list(string)` | `[]` | no |
5959
| <a name="input_resource_group_description"></a> [resource\_group\_description](#input\_resource\_group\_description) | (Optional) The description of Resource Group. | `string` | `"Managed by Terraform."` | no |
6060
| <a name="input_resource_group_enabled"></a> [resource\_group\_enabled](#input\_resource\_group\_enabled) | (Optional) Whether to create Resource Group to find and group AWS resources which are created by this module. | `bool` | `true` | no |
6161
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | (Optional) The name of Resource Group. A Resource Group name can have a maximum of 127 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with `AWS` or `aws`. | `string` | `""` | no |
6262
| <a name="input_subnets"></a> [subnets](#input\_subnets) | (Optional) A list of subnet IDs to associate with the route table. | `list(string)` | `[]` | no |
6363
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A map of tags to add to all resources. | `map(string)` | `{}` | no |
64-
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | (Optional) How long to wait for the route table to be created/updated/deleted. | <pre>object({<br> create = optional(string, "5m")<br> update = optional(string, "2m")<br> delete = optional(string, "5m")<br> })</pre> | `{}` | no |
64+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | (Optional) How long to wait for the route table to be created/updated/deleted. | <pre>object({<br/> create = optional(string, "5m")<br/> update = optional(string, "2m")<br/> delete = optional(string, "5m")<br/> })</pre> | `{}` | no |
6565
| <a name="input_vpc_gateway_endpoints"></a> [vpc\_gateway\_endpoints](#input\_vpc\_gateway\_endpoints) | (Optional) A list of the VPC Endpoint IDs with which the Route Table will be associated. | `list(string)` | `[]` | no |
6666

6767
## Outputs

modules/route-table/outputs.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ output "ipv4_routes" {
2727
description = "A list of route rules for destinations to IPv4 CIDRs."
2828
value = [
2929
for route in var.ipv4_routes : {
30+
id = aws_route.ipv4[route.destination].id,
31+
state = aws_route.ipv4[route.destination].state,
3032
destination = route.destination
3133
target = {
32-
id = aws_route.ipv4[route.destination].id,
33-
state = aws_route.ipv4[route.destination].state,
34-
type = route.target.type
34+
type = route.target.type
3535
id = coalesce(
3636
aws_route.ipv4[route.destination].carrier_gateway_id,
3737
aws_route.ipv4[route.destination].core_network_arn,
@@ -53,11 +53,11 @@ output "ipv6_routes" {
5353
description = "A list of route rules for destinations to IPv6 CIDRs."
5454
value = [
5555
for route in var.ipv6_routes : {
56+
id = aws_route.ipv6[route.destination].id,
57+
state = aws_route.ipv6[route.destination].state,
5658
destination = route.destination
5759
target = {
58-
id = aws_route.ipv6[route.destination].id,
59-
state = aws_route.ipv6[route.destination].state,
60-
type = route.target.type
60+
type = route.target.type
6161
id = coalesce(
6262
aws_route.ipv6[route.destination].carrier_gateway_id,
6363
aws_route.ipv6[route.destination].core_network_arn,
@@ -79,11 +79,11 @@ output "prefix_list_routes" {
7979
description = "A list of route rules for destinations to Prefix Lists."
8080
value = [
8181
for route in var.prefix_list_routes : {
82+
id = aws_route.prefix_list[route.destination].id,
83+
state = aws_route.prefix_list[route.destination].state,
8284
destination = route.destination
8385
target = {
84-
id = aws_route.prefix_list[route.destination].id,
85-
state = aws_route.prefix_list[route.destination].state,
86-
type = route.target.type
86+
type = route.target.type
8787
id = coalesce(
8888
aws_route.prefix_list[route.destination].carrier_gateway_id,
8989
aws_route.prefix_list[route.destination].core_network_arn,

0 commit comments

Comments
 (0)