Open romanvilu opened 1 month ago
Hi @bschaatsbergen, I would like to work on this
Thank you for raising this issue, @romanvilu!
Note that you now have the ability to develop your own functions using provider-defined functions.
If you're interested, please also see the provider-defined functions documentation to learn how to implement functions in your providers. If you are new to provider development, you can learn how to create a new provider with the Terraform Plugin Framework. For any questions, please visit the Terraform Plugin Development category in our official forum.
Hi @bschaatsbergen, I would like to work on this
Hey @rajat-ventura, feel free to propose a PR! If you’re interested in contributing to Terraform, please begin by reviewing the contributing guide and following the process outlined there. As mentioned above, depending on the Terraform core team’s input, this function may be preferred as a provider-defined function within a specific provider.
Hey @bschaatsbergen , Is someone working on this or can I pick this up?
Hi @virajbhartiya, please see https://github.com/hashicorp/terraform/issues/35909#issuecomment-2443696798 -- same answer. Read the contributing guide, follow the process. Thanks!
Terraform Version
Use Cases
Terraform has introduced the transpose function for maps, but there is no equivalent function for lists. A transpose function for lists would be beneficial for transforming an input like:
into an output like:
Such a function would be extremely useful when working with multiple lists as outputs from a module, which then need to be combined. For example, my Terraform module outputs the following lists:
Each output contains lists of node names, fixed IP addresses, and floating IP addresses. From these lists, I need to create a combined list of
[name, fixed_ip, floating_ip]
for each node.Attempted Solutions
The following code snippet transposes a list of lists in Terraform using nested
for
expressions. Thetry
function is applied to handle cases where some inner lists may be shorter than others, substitutingnull
for any missing elements:Proposal
No response
References
No response