terraform-google-modules/terraform-google-vm

Allow ip aliases configuration

thiagonache opened this issue · 3 comments

TL;DR

I want to be able to set ip aliases while create compute instances. Would you accept a PR for it?

Terraform Resources

compute instances

Detailed design

The idea is to have a new variable

variable "alias_ip_range" {
  description = "(Optional) An array of alias IP ranges for this network interface. Can only be specified for network interfaces on subnet-mode networks."
  type = list(object({
    ip_cidr_range         = string
    subnetwork_range_name = string
  }))
  default = []
}

And add a dynamic block inside of network interface

    dynamic "alias_ip_range" {
      for_each = var.alias_ip_range
      content {
        ip_cidr_range         = alias_ip_range.value.ip_cidr_range
        subnetwork_range_name = alias_ip_range.value.subnetwork_range_name
      }
    }


### Additional information

_No response_

Which module would you put this on?

Got it. yes this could be included within the network_interfaces config on the module.