Chef14 Load a provider in a recipe Chef::Provider::DeployKeyGithub I have a problem during migration of chef-client 12 to chef-client 14 and seems that the old way to load Providers is different in chef14

Chef::Provider::DeployKeyGithub cannot be load

    deploy_key deploy_key_name do
        provider Chef::Provider::DeployKeyGithub
        path "/home/#{current_user}/.ssh"
        credentials({
            :token =&gt; File.read('/root/someid').strip
        })
        repo 'test/test_config'
        owner 'root'
        group 'root'
        mode '0400'
        action :add
    end


Error:

================================================================================

NameError
---------
uninitialized constant Chef::Provider::DeployKeyGithub

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/flume_wrapper/recipes/default.rb:89:in `block in from_file'
  /var/chef/cache/cookbooks/flume_wrapper/recipes/default.rb:88:in `from_file'```

Does anyone knows how is the new way to load a Provider in a recipe for chef14 client?
This compatibility issue was solved for chef14 with the new load format of a provider in a recipe.

deploy_key deploy_key_name do
      provider Chef::ProviderResolver.new(node, find_resource!("deploy_key[github]"), :nothing).resolve
      path "/home/#{current_user}/.ssh"
      credentials({
          :token =&gt; File.read('/root/someid').strip
      })
      repo 'test/test_config'
      owner 'root'
      group 'root'
      mode '0400'
      action :add
  end