Skip to content

Commit

Permalink
dynamic set block test
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed Jul 12, 2019
1 parent 5eb0750 commit 1bc7713
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions builtin/providers/test/resource_nested_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,3 +620,46 @@ 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" "b" {
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
},
),
},
},
})
}

0 comments on commit 1bc7713

Please sign in to comment.