aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go')
-rw-r--r--vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go b/vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go
new file mode 100644
index 0000000..18a7e99
--- /dev/null
+++ b/vendor/github.com/hashicorp/terraform/plans/objchange/all_null.go
@@ -0,0 +1,18 @@
1package objchange
2
3import (
4 "github.com/hashicorp/terraform/configs/configschema"
5 "github.com/zclconf/go-cty/cty"
6)
7
8// AllAttributesNull constructs a non-null cty.Value of the object type implied
9// by the given schema that has all of its leaf attributes set to null and all
10// of its nested block collections set to zero-length.
11//
12// This simulates what would result from decoding an empty configuration block
13// with the given schema, except that it does not produce errors
14func AllAttributesNull(schema *configschema.Block) cty.Value {
15 // "All attributes null" happens to be the definition of EmptyValue for
16 // a Block, so we can just delegate to that.
17 return schema.EmptyValue()
18}