Allow resources to be set via function
Merge branch 'resource_function'