Skip to content

Commit

Permalink
Use path-independent key
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Schoenborn authored and Oliver Schoenborn committed Mar 26, 2021
1 parent bf21593 commit 7780b82
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ locals {
// convert the stacks map to a map of paths to stack and module ID
stack_paths_map = merge([
for stack_id, modules in var.stacks_map : {
for module_id, info in modules: (info.path) => {
for module_id, info in modules: "${stack_id}/${module_id}" => {
stack_id = stack_id
module_id = module_id
path = info.path
}
}
]...)
}

resource "local_file" "stack_backend" {
for_each = local.stack_paths_map
filename = "${each.key}/backend.tf"
filename = "${each.value.path}/backend.tf"
file_permission = "0644"

content = <<EOF
Expand Down

0 comments on commit 7780b82

Please sign in to comment.