PaloAltoNetworks / terraform-aws-vmseries-modules

Terraform Reusable Modules for VM-Series on AWS
https://registry.terraform.io/modules/PaloAltoNetworks/vmseries-modules/aws
MIT License
40 stars 49 forks source link

[Bug Report] Unable to leverage existing EIP with vmseries #341

Closed d2rj2 closed 1 year ago

d2rj2 commented 1 year ago

Describe the bug

When trying to map an existing Elastic IP to a new vmseries ENI (specifying the eip_allocation_id variable), TF plan is failing because the "try(v.eip_allocation_id, false)" (line 54) does return a string (allocation id value) instead of a boolean. Then the if clause crashes with "The 'if' clause value is invalid: a bool is required." message.

Module Version

v1.0.1

Terraform version

v1.3.6

Expected behavior

Setting eip_allocation_id variable should work as expected

Current behavior

TF plan fails when eip_allocation_value is set to a correct value.

Anything else to add?

Something like that should fix the issue: for_each = { for k, v in var.interfaces : k => v if (try(v.eip_allocation_id, false) != false)}

welcome-to-palo-alto-networks[bot] commented 1 year ago

:tada: Thanks for opening your first issue here! Welcome to the community!

sebastianczech commented 1 year ago

Changes are merged in #342