// ForgetResourceInstanceDeposed removes the record of the deposed object with
// the given address and key, if present. If not present, this is a no-op.
ForgetResourceInstanceDeposed removes the record of the deposed object with
the given address and key, if present. If not present, this is a no-op.
// ForgetResourceInstanceDeposed removes the record of the deposed object with // the given address and key if present . If not present this is a no - op .
func (ms *Module) ForgetResourceInstanceDeposed(addr addrs.ResourceInstance, key DeposedKey) {
	rs := ms.Resource(addr.Resource)
	if rs == nil {
		return
	}
	is := rs.Instance(addr.Key)
	if is == nil {
		return
	}
	delete(is.Deposed, key)
	if !is.HasObjects() {
		delete(rs.Instances, addr.Key)
	}
	if len(rs.Instances) == 0 {
		delete(ms.Resources, addr.Resource.String())
	}
}
func ( ms * Module ) ForgetResourceInstanceDeposed ( addr addrs . ResourceInstance , key DeposedKey ) { rs := ms . Resource ( addr . Resource ) if rs == nil { return } is := rs . Instance ( addr . Key ) if is == nil { return } delete ( is . Deposed , key ) if ! is . HasObjects ( ) { delete ( rs . Instances , addr . Key ) } if len ( rs . Instances ) == 0 { delete ( ms . Resources , addr . Resource . String ( ) ) } }
ForgetResourceInstanceDeposed removes the record of the deposed object with
the given address and key, if present.
ForgetResourceInstanceDeposed removes the record of the deposed object with the given address and key if present .
// If we have no objects at all then we'll clean up. // Also clean up if we only expect to have one instance anyway // and there are none. We leave the resource behind if an each mode // is active because an empty list or map of instances is a valid state.