Module execution in subfolders

I have a environment for poc/uat/prd.

This works fine and the modules have been created in such a way that as a example I just provide a region, purpose and index and the object is created with poc/uat/prd in the name.

But now the ultimate goal would be that I just have to copy the templates from dev to uat and somewhere a main.tf loops/for-eaches all templates.
I’ll illustrate

_modules

  • storage
  • adls
  • create-adls
    | main.tf
    | variables.tf
    DAS-project
  • config
  • dev
    | main.tf
    | providers.tf
    | variables.tf
  • adls
    | dev-001
    | dev-002
  • uat
    | main.tf
    | providers.tf
    | variables.tf
  • adls
  • templates
  • adls
    | das-001
    • main.tf
    • variables.tf
      | das-002

    • | das-003

The idea would be that for each environment we execute all common adls (still unique due to the naming) and then the environment specific.
Hard-coded this is not a problem, but I’m dreaming of a generic rule to do this.

Bottom line, promoting services from dev to uat would then be just a simple copy of a folder from one place to another, no worries about editing too much files each time.
We have a run-partner that implements our releases, so editing files should be avoided.

Any suggestions ?

I’ve see demos and tutorials on count and for-each, but couldn’t find a way to loop directories dynamical.