You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing the "routes" variable type to be more specific on the main network module and on the routes module.
Right now, it's too generic.
Terraform Resources
On version 9.3.0
variable "routes" {
type = list(map(string))
description = "List of routes being created in this VPC"
default = []
}
Detailed design
I suggest a solution where the specific choices are visible, for example:
variable "routes" {
type = list(map(object({
name = optional(string)
description = optional(string)
tags = string
destination_range = string
next_hop_internet = optional(bool, false)
next_hop_ip = optional(string)
next_hop_instance = optional(string)
next_hop_instance_zone = optional(string)
next_hop_vpn_tunnel = optional(string)
priority = optional(string, "1000")
})))
description = "List of routes being created in this VPC"
default = []
}
This implies changing it on root/variables.tf and on root/modules/routes/variables.tf
Additional information
This solution will help developers who uses the network module or directly the route module, to design a solution where we can specify the variable elements directly, and it would be more similar to the rest of the resources (firewall, secondary networks, etc.)
The text was updated successfully, but these errors were encountered:
TL;DR
Changing the "routes" variable type to be more specific on the main network module and on the routes module.
Right now, it's too generic.
Terraform Resources
On version 9.3.0
variable "routes" {
type = list(map(string))
description = "List of routes being created in this VPC"
default = []
}
Detailed design
I suggest a solution where the specific choices are visible, for example:
variable "routes" {
type = list(map(object({
name = optional(string)
description = optional(string)
tags = string
destination_range = string
next_hop_internet = optional(bool, false)
next_hop_ip = optional(string)
next_hop_instance = optional(string)
next_hop_instance_zone = optional(string)
next_hop_vpn_tunnel = optional(string)
priority = optional(string, "1000")
})))
description = "List of routes being created in this VPC"
default = []
}
This implies changing it on root/variables.tf and on root/modules/routes/variables.tf
Additional information
This solution will help developers who uses the network module or directly the route module, to design a solution where we can specify the variable elements directly, and it would be more similar to the rest of the resources (firewall, secondary networks, etc.)
The text was updated successfully, but these errors were encountered: