Since the introduction of the for_each feature in Terraform 0.12 it is now possible to code powerful constructs to express the logic of your infrastructure. But sometimes you have to use some creativity to use this feature. I recently had to write a Terraform code that could upload all the JavaScript files from a local …