// ForgetResourceInstanceAll removes the record of all objects associated with
// the specified resource instance, if present. If not present, this is a no-op.
ForgetResourceInstanceAll removes the record of all objects associated with
the specified resource instance, if present. If not present, this is a no-op.
// ForgetResourceInstanceAll removes the record of all objects associated with // the specified resource instance if present . If not present this is a no - op .
func (ms *Module) ForgetResourceInstanceAll(addr addrs.ResourceInstance) {
	rs := ms.Resource(addr.Resource)
	if rs == nil {
		return
	}
	delete(rs.Instances, addr.Key)
	if len(rs.Instances) == 0 {
		delete(ms.Resources, addr.Resource.String())
	}
}
func ( ms * Module ) ForgetResourceInstanceAll ( addr addrs . ResourceInstance ) { rs := ms . Resource ( addr . Resource ) if rs == nil { return } delete ( rs . Instances , addr . Key ) if len ( rs . Instances ) == 0 { delete ( ms . Resources , addr . Resource . String ( ) ) } }
ForgetResourceInstanceAll removes the record of all objects associated with
the specified resource instance, if present.
ForgetResourceInstanceAll removes the record of all objects associated with the specified resource instance if present .
// 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.