Skip to content

Trying to use looped outputs of a module in another module/loop #14653

Closed Answered by samtjordan23
samtjordan23 asked this question in General
Discussion options

You must be logged in to vote

So I was able to get this working. I was overthinking this, and just needed to pass the array into the module, and let the module handle the information from there. Most of the changes happened in the DNS module at the bottom.

  1. I had to pass the outputs into the module as an array
  2. I had to define it at the top of the module as an array (like you would any variable set)
  3. I then had to use my groupid variable to loop through the array for the existing azuredns zone names
  4. I then had to get the existing dns zones in my environment using the dnsZones variable
  5. I was then able to iterate through my privateendpoint results, and create the appropriate DNS record with the appropriate IP address

Her…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@samtjordan23
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by samtjordan23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants