diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go b/vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go index 2f2463a..47a0256 100644 --- a/vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go +++ b/vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go | |||
@@ -55,10 +55,11 @@ func effectiveSchema(given *hcl.BodySchema, body hcl.Body, ambiguousNames map[st | |||
55 | }, | 55 | }, |
56 | } | 56 | } |
57 | content, _, _ = body.PartialContent(&probeSchema) | 57 | content, _, _ = body.PartialContent(&probeSchema) |
58 | if len(content.Blocks) > 0 { | 58 | if len(content.Blocks) > 0 || dynamicExpanded { |
59 | // No attribute present and at least one block present, so | 59 | // A dynamic block with an empty iterator returns nothing. |
60 | // we'll need to rewrite this one as a block for a successful | 60 | // If there's no attribute and we have either a block or a |
61 | // result. | 61 | // dynamic expansion, we need to rewrite this one as a |
62 | // block for a successful result. | ||
62 | appearsAsBlock[name] = struct{}{} | 63 | appearsAsBlock[name] = struct{}{} |
63 | } | 64 | } |
64 | } | 65 | } |