f5devcentral / terraform-xc-aws-ce

Terraform to create F5XC AWS cloud CE
Apache License 2.0
4 stars 4 forks source link

"var.aws_existing_sg_sli_ids is empty list of string" when attempting to deploy single_node_multi_nic_new_vpc_new_subnet #2

Closed ghost closed 7 months ago

ghost commented 9 months ago

I'm attempting to run the TF plan for single_node_multi_nic_new_vpc_new_subnet and I'm receiving the following error:

╷
│ Error: Invalid operand
│ 
│   on ../../modules/f5xc/ce/aws/main.tf line 56, in module "network_node":
│   56:   aws_sg_sli_ids                     = local.is_multi_nic ? length(var.aws_existing_sg_sli_ids > 0) ? var.aws_existing_sg_sli_ids : module.network_common.common["sg_sli_ids"] : []
│     ├────────────────
│     │ var.aws_existing_sg_sli_ids is empty list of string
│ 
│ Unsuitable value for left operand: number required.
╵
ghost commented 9 months ago

Fixed by changing line 56 in modules/f5xc/ce/aws/main.tf:

from

  aws_sg_sli_ids                     = local.is_multi_nic ? length(var.aws_existing_sg_sli_ids > 0) ? var.aws_existing_sg_sli_ids : module.network_common.common["sg_sli_ids"] : []

to

  aws_sg_sli_ids                     = local.is_multi_nic ? length(var.aws_existing_sg_sli_ids) > 0 ? var.aws_existing_sg_sli_ids : module.network_common.common["sg_sli_ids"] : []