code: func (s *Config) CheckAndSetDefaults() error {
  	if s.Bucket == "" {
  		return trace.BadParameter("missing parameter Bucket")
  	}
  	if s.Session == nil {
  		// create an AWS session using default SDK behavior, i.e. it will interpret
  		// the environment and ~/.aws directory just like an AWS CLI tool would:
  		sess, err := awssession.NewSessionWithOptions(awssession.Options{
  			SharedConfigState: awssession.SharedConfigEnable,
  		})
  		if err != nil {
  			return trace.Wrap(err)
  		}
  		// override the default environment (region + credentials) with the values
  		// from the YAML file:
  		if s.Region != "" {
  			sess.Config.Region = aws.String(s.Region)
  		}
  		s.Session = sess
  	}
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets defaults