github.com/hugorut/terraform@v1.1.3/src/terraform/testdata/plan-modules-expand/main.tf (about)

     1  locals {
     2    val = 2
     3    bar = "baz"
     4    m = {
     5      "a" = "b"
     6    }
     7  }
     8  
     9  variable "myvar" {
    10    default = "baz"
    11  }
    12  
    13  module "count_child" {
    14    count = local.val
    15    foo = count.index
    16    bar = var.myvar
    17    source = "./child"
    18  }
    19  
    20  module "for_each_child" {
    21    for_each = aws_instance.foo
    22    foo = 2
    23    bar = each.key
    24    source = "./child"
    25  }
    26  
    27  resource "aws_instance" "foo" {
    28    for_each = local.m
    29  }