terraform { required_providers { docker = { source = "kreuzwerker/docker" version = "2.15.0" } } } locals { images = [ { name = "foo", image = "alpine" }, { name = "bar", image = "debian" }, ] } resource "docker_container" "this" { # for_each = local.images ããã«mapã®listã渡ããããã¨ã©ã¼ã«ãªã for_each = { for i in local.images : i.name => i } # ããæ¸ãã®ãæ£ãã name = each.value.name image = each.value.image } ãã te
{{#tags}}- {{label}}
{{/tags}}