Skip to content

Change routes variable type. #583

@KevinAbregu

Description

@KevinAbregu

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions