Skip to main content

NPA Terraform - failing to loop over multiple maps

  • October 27, 2023
  • 1 reply
  • 49 views

elawaetz
Forum|alt.badge.img+4

I'm trying to build a module (currently just playing with locals directly in main.tf) which will build an instance of a private app. for each DC and tie it to the local publishers in that DC.

 

That part is working, but I am failing to also tie the protocols fields correctly in and iterate over those as well, as the attached code will fail if either of the protocol ports fields are empty (in the case where an app only has tcp or udp ports defined).

 

@sshiflett ?

This topic has been closed for replies.

1 reply

Forum|alt.badge.img+16
  • Netskope Employee
  • October 30, 2023

Hello @elawaetz

It's been some time since I tested this but I believe if you pass the protocol type as part of the call (TCP or UDP) then it expects a valid entry.  You may need to build logic that if there is no entry for the TCP or UDP protocol to not pass it at all. I will do a bit of digging but have not tested with our newer provider versions.