dynamic set block test

This commit is contained in:
James Bardin 2019-07-12 16:34:03 -04:00
parent 7a183a0e90
commit efd2a6cef6
1 changed files with 36 additions and 0 deletions

View File

@ -620,3 +620,39 @@ resource "test_resource_nested_set" "bar" {
},
})
}
func TestResourceNestedSet_dynamicSetBlock(t *testing.T) {
resource.UnitTest(t, resource.TestCase{
Providers: testAccProviders,
CheckDestroy: testAccCheckResourceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: strings.TrimSpace(`
resource "test_resource" "a" {
required = "ok"
required_map = {
a = "b"
}
}
resource "test_resource_nested_set" "foo" {
dynamic "with_list" {
iterator = thing
for_each = test_resource.a.computed_list
content {
required = thing.value
list = [thing.key]
}
}
}
`),
Check: resource.ComposeTestCheckFunc(
func(s *terraform.State) error {
fmt.Println(s)
return nil
},
),
},
},
})
}