diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/lang/blocktoattr')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go | 9 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/terraform/lang/blocktoattr/variables.go | 2 |
2 files changed, 6 insertions, 5 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 | } |
diff --git a/vendor/github.com/hashicorp/terraform/lang/blocktoattr/variables.go b/vendor/github.com/hashicorp/terraform/lang/blocktoattr/variables.go index e123b8a..b172805 100644 --- a/vendor/github.com/hashicorp/terraform/lang/blocktoattr/variables.go +++ b/vendor/github.com/hashicorp/terraform/lang/blocktoattr/variables.go | |||
@@ -33,7 +33,7 @@ func walkVariables(node dynblock.WalkVariablesNode, body hcl.Body, schema *confi | |||
33 | for _, child := range children { | 33 | for _, child := range children { |
34 | if blockS, exists := schema.BlockTypes[child.BlockTypeName]; exists { | 34 | if blockS, exists := schema.BlockTypes[child.BlockTypeName]; exists { |
35 | vars = append(vars, walkVariables(child.Node, child.Body(), &blockS.Block)...) | 35 | vars = append(vars, walkVariables(child.Node, child.Body(), &blockS.Block)...) |
36 | } else if attrS, exists := schema.Attributes[child.BlockTypeName]; exists { | 36 | } else if attrS, exists := schema.Attributes[child.BlockTypeName]; exists && attrS.Type.ElementType().IsObjectType() { |
37 | synthSchema := SchemaForCtyElementType(attrS.Type.ElementType()) | 37 | synthSchema := SchemaForCtyElementType(attrS.Type.ElementType()) |
38 | vars = append(vars, walkVariables(child.Node, child.Body(), synthSchema)...) | 38 | vars = append(vars, walkVariables(child.Node, child.Body(), synthSchema)...) |
39 | } | 39 | } |