func (i *ResourceInstance) HasObjects() bool {
	return i.Current != nil || len(i.Deposed) != 0
}
HasObjects returns true if this resource has any objects at all, whether
current or deposed.
package states
import (
	"fmt"
	"math/rand"
	"time"
	"github.com/camptocamp/terraboard/internal/terraform/addrs"
)
type Resource struct {
	Addr addrs.AbsResource
	Instances map[addrs.InstanceKey]*ResourceInstance
	ProviderConfig addrs.AbsProviderConfig
}
func (rs *Resource) Instance(key addrs.InstanceKey) *ResourceInstance {
	return rs.Instances[key]
}
func (rs *Resource) CreateInstance(key addrs.InstanceKey) *ResourceInstance {
	is := NewResourceInstance()
	rs.Instances[key] = is
	return is
}
func (rs *Resource) EnsureInstance(key addrs.InstanceKey) *ResourceInstance {
	ret := rs.Instance(key)
	if ret == nil {
		ret = NewResourceInstance()
		rs.Instances[key] = ret
	}
	return ret
}
type ResourceInstance struct {
	Current *ResourceInstanceObjectSrc
	Deposed map[DeposedKey]*ResourceInstanceObjectSrc
}
func NewResourceInstance() *ResourceInstance {
	return &ResourceInstance{
		Deposed: map[DeposedKey]*ResourceInstanceObjectSrc{},
	}
}
func (i *ResourceInstance) HasCurrent() bool {
	return i != nil && i.Current != nil
}
func (i *ResourceInstance) HasDeposed(key DeposedKey) bool {
	return i != nil && i.Deposed[key] != nil
}
func (i *ResourceInstance) HasAnyDeposed() bool {
	return i != nil && len(i.Deposed) > 0
}