Skip to content

Commit

Permalink
feat: route_table_ids pluralized (#83)
Browse files Browse the repository at this point in the history
* feat: route_table_ids pluralized

BREAKING CHANGE:
- route_table_id -> route_table_ids

* Continuous Integration - terraform fmt and terraform-docs

* updated README.md with new variable name
  • Loading branch information
zachreborn authored Nov 20, 2024
1 parent 12363a5 commit 80308d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions modules/aws/route/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<h3 align="center">Route Module</h3>
<p align="center">
This module configures a route
This module configures a route within a VPC.
<br />
<a href="https://github.com/zachreborn/terraform-modules"><strong>Explore the docs »</strong></a>
<br />
Expand Down Expand Up @@ -69,7 +69,7 @@ module "sdwan_route_branches" {
# Branches - Summary route for all branches
destination_cidr_block = "10.0.0.0/8"
network_interface_id = module.aws_prod_meraki.primary_network_interface_id[0]
route_table_id = [module.vpc.db_route_table_ids, module.vpc.dmz_route_table_ids, module.vpc.mgmt_route_table_ids, module.vpc.private_route_table_ids, module.vpc.public_route_table_ids, module.vpc.workspaces_route_table_ids]
route_table_ids = [module.vpc.db_route_table_ids, module.vpc.dmz_route_table_ids, module.vpc.mgmt_route_table_ids, module.vpc.private_route_table_ids, module.vpc.public_route_table_ids, module.vpc.workspaces_route_table_ids]
}
```

Expand Down Expand Up @@ -115,7 +115,7 @@ No modules.
| <a name="input_local_gateway_id"></a> [local\_gateway\_id](#input\_local\_gateway\_id) | (Optional) Identifier of a Outpost local gateway. | `string` | `null` | no |
| <a name="input_nat_gateway_id"></a> [nat\_gateway\_id](#input\_nat\_gateway\_id) | (Optional) An ID of a VPC NAT gateway. | `string` | `null` | no |
| <a name="input_network_interface_id"></a> [network\_interface\_id](#input\_network\_interface\_id) | (Optional) An ID of a network interface. | `string` | `null` | no |
| <a name="input_route_table_id"></a> [route\_table\_id](#input\_route\_table\_id) | (Required) The ID of the routing table. | `list(any)` | n/a | yes |
| <a name="input_route_table_ids"></a> [route\_table\_ids](#input\_route\_table\_ids) | (Required) The IDs of the routing tables to apply the route to. | `list(any)` | n/a | yes |
| <a name="input_transit_gateway_id"></a> [transit\_gateway\_id](#input\_transit\_gateway\_id) | (Optional) Identifier of an EC2 Transit Gateway. | `string` | `null` | no |
| <a name="input_vpc_endpoint_id"></a> [vpc\_endpoint\_id](#input\_vpc\_endpoint\_id) | (Optional) Identifier of a VPC Endpoint. | `string` | `null` | no |
| <a name="input_vpc_peering_connection_id"></a> [vpc\_peering\_connection\_id](#input\_vpc\_peering\_connection\_id) | (Optional) An ID of a VPC peering connection. | `string` | `null` | no |
Expand Down
4 changes: 2 additions & 2 deletions modules/aws/route/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {

resource "aws_route" "route" {
carrier_gateway_id = var.carrier_gateway_id
count = length(flatten(var.route_table_id))
count = length(flatten(var.route_table_ids))
destination_cidr_block = var.destination_cidr_block
destination_ipv6_cidr_block = var.destination_ipv6_cidr_block
egress_only_gateway_id = var.egress_only_gateway_id
Expand All @@ -19,7 +19,7 @@ resource "aws_route" "route" {
nat_gateway_id = var.nat_gateway_id
network_interface_id = var.network_interface_id
transit_gateway_id = var.transit_gateway_id
route_table_id = element(flatten(var.route_table_id), count.index)
route_table_id = element(flatten(var.route_table_ids), count.index)
vpc_endpoint_id = var.vpc_endpoint_id
vpc_peering_connection_id = var.vpc_peering_connection_id
}
4 changes: 2 additions & 2 deletions modules/aws/route/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ variable "transit_gateway_id" {
default = null
}

variable "route_table_id" {
variable "route_table_ids" {
type = list(any)
description = "(Required) The ID of the routing table."
description = "(Required) The IDs of the routing tables to apply the route to."
}

variable "vpc_endpoint_id" {
Expand Down

0 comments on commit 80308d8

Please sign in to comment.