func (obj *ResourceInstanceObject) DeepCopy() *ResourceInstanceObject {
	if obj == nil {
		return nil
	}
	var private []byte
	if obj.Private != nil {
		private = make([]byte, len(obj.Private))
		copy(private, obj.Private)
	}
	var dependencies []addrs.AbsResource
	if obj.Dependencies != nil {
		dependencies = make([]addrs.AbsResource, len(obj.Dependencies))
		copy(dependencies, obj.Dependencies)
	}
	return &ResourceInstanceObject{
		Value:        obj.Value,
		Status:       obj.Status,
		Private:      private,
		Dependencies: dependencies,
	}
}
DeepCopy returns a new resource instance object that contains equivalent data
to the receiver but shares no backing memory in common.

As with all methods on ResourceInstanceObject, this method is not safe to use
concurrently with writing to any portion of the recieving data structure. It
is the caller's responsibility to ensure mutual exclusion for the duration
of the operation, but may then freely modify the receiver and the returned
copy independently once this method returns.
package states
import (
	"github.com/hashicorp/terraform/addrs"
	"github.com/zclconf/go-cty/cty"
)
func (s *State) DeepCopy() *State {
	if s == nil {
		return nil
	}
	modules := make(map[string]*Module, len(s.Modules))
	for k, m := range s.Modules {
		modules[k] = m.DeepCopy()
	}
	return &State{
		Modules: modules,
	}
}
func (ms *Module) DeepCopy() *Module {
	if ms == nil {
		return nil
	}
	resources := make(map[string]*Resource, len(ms.Resources))
	for k, r := range ms.Resources {
		resources[k] = r.DeepCopy()
	}
	outputValues := make(map[string]*OutputValue, len(ms.OutputValues))
	for k, v := range ms.OutputValues {
		outputValues[k] = v.DeepCopy()
	}
	localValues := make(map[string]cty.Value, len(ms.LocalValues))
	for k, v := range ms.LocalValues {
		localValues[k] = v
	}
	return &Module{
		Addr:         ms.Addr,  
		Resources:    resources,
		OutputValues: outputValues,
		LocalValues:  localValues,
	}
}
func (rs *Resource) DeepCopy() *Resource {
	if rs == nil {
		return nil
	}
	instances := make(map[addrs.InstanceKey]*ResourceInstance, len(rs.Instances))
	for k, i := range rs.Instances {
		instances[k] = i.DeepCopy()
	}
	return &Resource{
		Addr:           rs.Addr,
		EachMode:       rs.EachMode,
		Instances:      instances,
		ProviderConfig: rs.ProviderConfig,  
	}
}
func (is *ResourceInstance) DeepCopy() *ResourceInstance {
	if is == nil {
		return nil
	}
	deposed := make(map[DeposedKey]*ResourceInstanceObjectSrc, len(is.Deposed))
	for k, obj := range is.Deposed {
		deposed[k] = obj.DeepCopy()
	}
	return &ResourceInstance{
		Current: is.Current.DeepCopy(),
		Deposed: deposed,
	}
}
func (obj *ResourceInstanceObjectSrc) DeepCopy() *ResourceInstanceObjectSrc {
	if obj == nil {
		return nil
	}
	var attrsFlat map[string]string
	if obj.AttrsFlat != nil {
		attrsFlat = make(map[string]string, len(obj.AttrsFlat))
		for k, v := range obj.AttrsFlat {
			attrsFlat[k] = v
		}
	}
	var attrsJSON []byte
	if obj.AttrsJSON != nil {
		attrsJSON = make([]byte, len(obj.AttrsJSON))
		copy(attrsJSON, obj.AttrsJSON)
	}
	var private []byte
	if obj.Private != nil {
		private = make([]byte, len(obj.Private))
		copy(private, obj.Private)
	}
	var dependencies []addrs.AbsResource
	if obj.Dependencies != nil {
		dependencies = make([]addrs.AbsResource, len(obj.Dependencies))
		copy(dependencies, obj.Dependencies)
	}
	var dependsOn []addrs.Referenceable
	if obj.DependsOn != nil {
		dependsOn = make([]addrs.Referenceable, len(obj.DependsOn))
		copy(dependsOn, obj.DependsOn)
	}
	return &ResourceInstanceObjectSrc{
		Status:        obj.Status,
		SchemaVersion: obj.SchemaVersion,
		Private:       private,
		AttrsFlat:     attrsFlat,
		AttrsJSON:     attrsJSON,
		Dependencies:  dependencies,
		DependsOn:     dependsOn,
	}
}