def credentials(opts = {})
      p = opts[:profile] || @profile_name
      validate_profile_exists(p) if credentials_present?
      if credentials = credentials_from_shared(p, opts)
        credentials
      elsif credentials = credentials_from_config(p, opts)
        credentials
      else
        nil
      end
    end
def credentials(opts = {})
      p = opts[:profile] || @profile_name
      validate_profile_exists(p) if credentials_present?
      if credentials = credentials_from_shared(p, opts)
        credentials
      elsif credentials = credentials_from_config(p, opts)
        credentials
      else
        nil
      end
    end
Sources static credentials from shared credential/config files.

 @param [Hash] opts
 @option options [String] :profile the name of the configuration file from
   which credentials are being sourced.
 @return [Aws::Credentials] credentials sourced from configuration values,
   or `nil` if no valid credentials were found.