Skip to content

Instantly share code, notes, and snippets.

@dtelaroli
Created October 7, 2022 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dtelaroli/45c9ebf1d17275c30d3ff083d6932372 to your computer and use it in GitHub Desktop.
Save dtelaroli/45c9ebf1d17275c30d3ff083d6932372 to your computer and use it in GitHub Desktop.
workaround to list all directories in a specific folder in terraform
locals {
subfolders = toset(distinct(flatten([for _, v in fileset(".", "./dir/**") : regex("./dir/([^/]*).*", dirname(v))])))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment