How do I get list of all the folders in terraform

I am trying to list all the folders in ${path.root}.

Is it possible.

1 Like

distinct(flatten([for _, v in flatten(fileset(path.module, “…/squads/**”)) : regex(“…/squads/([^/]).”, dirname(v))]))

1 Like

This would skip empty directories