Get ip address from machine after creation

I would like to get the IP address of a node after creation using the machine resource. Is it possible to do something like this:

instance = machine "#{instance_name}" do
  role base_role
  attributes attrs
end

log "ip log" do
  message "#{instance.name} has IP address #{instance.ipaddress}"
  level :info
end