Skip to content

Instantly share code, notes, and snippets.

@fegger-ducksify
Last active June 14, 2023 08:34
Show Gist options
  • Select an option

  • Save fegger-ducksify/8df0f02cfeaa3986740b4840d0caa632 to your computer and use it in GitHub Desktop.

Select an option

Save fegger-ducksify/8df0f02cfeaa3986740b4840d0caa632 to your computer and use it in GitHub Desktop.
key1: test1
key2: test2
key3: test3
key4: test4
locals {
yaml_content = yamldecode(file("${path.module}/data.yaml"))
}
resource "local_file" "createfile" {
for_each = local.yaml_content
filename = each.key
content = each.value
provisioner "local-exec" {
command = "sleep 5"
}
}
output "example_output" {
value = local.yaml_content["key1"]
}
output "example_output2" {
value = local.yaml_content["key2"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment