github.com/hashicorp/terraform-plugin-sdk@v1.17.2/internal/plans/objchange/all_null.go (about)

     1  package objchange
     2  
     3  import (
     4  	"github.com/hashicorp/terraform-plugin-sdk/internal/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
    14  func 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  }