code: func (s *Schema) coreConfigSchemaBlock() *configschema.NestedBlock {
  	ret := &configschema.NestedBlock{}
  	if nested := s.Elem.(*Resource).coreConfigSchema(); nested != nil {
  		ret.Block = *nested
  	}
  	switch s.Type {
  	case TypeList:
  		ret.Nesting = configschema.NestingList
  	case TypeSet:
  		ret.Nesting = configschema.NestingSet
  	case TypeMap:
  		ret.Nesting = configschema.NestingMap
  	default:
  		// Should never happen for a valid schema
  		panic(fmt.Errorf("invalid s.Type %s for s.Elem being resource", s.Type))
  	}
  
  	ret.MinItems = s.MinItems
  	ret.MaxItems = s.MaxItems
  
  	if s.Required && s.MinItems == 0 {
  		// configschema doesn't have a "required" representation for nested
  		// blocks, but we can fake it by requiring at least one item.
  		ret.MinItems = 1
  	}
  	if s.Optional && s.MinItems > 0 {
  		// Historically helper/schema would ignore MinItems if Optional were
  		// set, so we must mimic this behavior here to ensure that providers
  		// relying on that undocumented behavior can continue to operate as
  		// they did before.
  		ret.MinItems = 0
  	}
  	if s.Computed && !s.Optional {
  		// MinItems/MaxItems are meaningless for computed nested blocks, since
  		// they are never set by the user anyway. This ensures that we'll never
  		// generate weird errors about them.
  		ret.MinItems = 0
  		ret.MaxItems = 0
  	}
  
  	return ret
  }
docs: // coreConfigSchemaBlock prepares a configschema.NestedBlock representation of
  // a schema. This is appropriate only for collections whose Elem is an instance
  // of Resource, and will panic otherwise.