code: func (s *Schema) coreConfigSchemaAttribute() *configschema.Attribute {
  	// The Schema.DefaultFunc capability adds some extra weirdness here since
  	// it can be combined with "Required: true" to create a sitution where
  	// required-ness is conditional. Terraform Core doesn't share this concept,
  	// so we must sniff for this possibility here and conditionally turn
  	// off the "Required" flag if it looks like the DefaultFunc is going
  	// to provide a value.
  	// This is not 100% true to the original interface of DefaultFunc but
  	// works well enough for the EnvDefaultFunc and MultiEnvDefaultFunc
  	// situations, which are the main cases we care about.
  	//
  	// Note that this also has a consequence for commands that return schema
  	// information for documentation purposes: running those for certain
  	// providers will produce different results depending on which environment
  	// variables are set. We accept that weirdness in order to keep this
  	// interface to core otherwise simple.
  	reqd := s.Required
  	opt := s.Optional
  	if reqd && s.DefaultFunc != nil {
  		v, err := s.DefaultFunc()
  		// We can't report errors from here, so we'll instead just force
  		// "Required" to false and let the provider try calling its
  		// DefaultFunc again during the validate step, where it can then
  		// return the error.
  		if err != nil || (err == nil && v != nil) {
  			reqd = false
  			opt = true
  		}
  	}
  
  	return &configschema.Attribute{
  		Type:        s.coreConfigSchemaType(),
  		Optional:    opt,
  		Required:    reqd,
  		Computed:    s.Computed,
  		Sensitive:   s.Sensitive,
  		Description: s.Description,
  	}
  }
docs: // coreConfigSchemaAttribute prepares a configschema.Attribute representation
  // of a schema. This is appropriate only for primitives or collections whose
  // Elem is an instance of Schema. Use coreConfigSchemaBlock for collections
  // whose elem is a whole resource.