]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/github.com/hashicorp/terraform/lang/blocktoattr/schema.go
update vendor and go.mod
[github/fretlink/terraform-provider-statuscake.git] / vendor / github.com / hashicorp / terraform / lang / blocktoattr / schema.go
index 2f2463a5cdb4f4c27288652bd7165a1ccdca92d4..47a02565922899b2f9967d9f144aecf54f66a307 100644 (file)
@@ -55,10 +55,11 @@ func effectiveSchema(given *hcl.BodySchema, body hcl.Body, ambiguousNames map[st
                                },
                        }
                        content, _, _ = body.PartialContent(&probeSchema)
-                       if len(content.Blocks) > 0 {
-                               // No attribute present and at least one block present, so
-                               // we'll need to rewrite this one as a block for a successful
-                               // result.
+                       if len(content.Blocks) > 0 || dynamicExpanded {
+                               // A dynamic block with an empty iterator returns nothing.
+                               // If there's no attribute and we have either a block or a
+                               // dynamic expansion, we need to rewrite this one as a
+                               // block for a successful result.
                                appearsAsBlock[name] = struct{}{}
                        }
                }