terraform-aviatrix-modules / terraform-aviatrix-mc-transit

Aviatrix Terraform module for transit deployment in multiple clouds
Apache License 2.0
0 stars 18 forks source link

enable_egress_transit_firenet requires that enable_transit_firenet also be set #10

Closed rnxrx closed 1 year ago

rnxrx commented 1 year ago

In earlier versions enable_transit_firenet and enable_egress_transit_firenet were independently selectable. The behavior now is that to use enable_egress_transit_firenet that enable_transit_firenet also has to be set or will fail with:

 Error: Invalid index

  on .terraform/modules/egress/main.tf line 115, in resource "aviatrix_transit_gateway" "default":
  115:   lan_vpc_id         = local.enable_transit_firenet && local.cloud == "gcp" ? aviatrix_vpc.lan_vpc[0].name : null
     ├────────────────
     │ aviatrix_vpc.lan_vpc is empty tuple

 The given key does not identify an element in this collection value: the collection has no elements.

In the GUI it's not possible to set egress transit firenet without having first enabled transit firenet. As such in the module there should either be an explicit requirement for enable_transit_firenet to activate enable_egress_transit_firenet (validation check + documentation) or setting enable_egress_transit_firenet should implicitly be setting enable_transit_firenet and thus be mutually exclusive.

Dennizz commented 1 year ago

I made a change that should handle this. Please test if the main branch resolves this, by setting your source to:

source = "git::https://github.com/terraform-aviatrix-modules/terraform-aviatrix-mc-transit

Dennizz commented 1 year ago

Issue addressed