Function to dynamically create resources from hashes