remote_file resource can be used whenever you want to download some file off a remote server somewhere. It is very similar to the file resource or the cookbook_file and you can use it to actually create some file on a node.
Example in a cookbook.
apache/recipes/server.rb:
...
remote_file '/var/www/html/image.png' do
source 'https://miro.medium.com/max/700/0*hPVHCGVgepguJt8I'
end
template '/var/www/html/index.html' do
source 'index.html.erb'
variables(:name => "Dmitri")
end
...
apache/templates/index.html.erb:
Hello <%= @name %>
HOSTNAME: <%= node['hostname'] %>
IPADDRESS: <%= node['ipaddress'] %>
<img src='image.png'>