Skip to content

Instantly share code, notes, and snippets.

@JrCs
Created November 28, 2019 09:31
Show Gist options
  • Save JrCs/6f98adf65c2adaa610d4068d898f610d to your computer and use it in GitHub Desktop.
Save JrCs/6f98adf65c2adaa610d4068d898f610d to your computer and use it in GitHub Desktop.
Terraform: replace template_dir
resource "local_file" "generated_file" {
for_each = fileset("my_source_dir", "[^.]*")
filename = "my_destination_dir/${each.value}"
content = templatefile("my_source_dir/${each.value}", {
"my_var" = "my_value"
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment