I've just pushed a commit to my repo in feature/resource_template that provides client-side templates. The templates are evaluated with access to the specified resource's attributes.
They're mostly useful for building composite resources, maybe like so:
... my resource code ...
def generate
Puppet::Type.type(:file).create :path => "/my/file",
content => Puppet::Util::ResourceTemplate.new("/my/template", self).evaluate
end
...
This is a small patch, and will likely rarely be used (and probably never from within Puppet's core), but it's already in use at a client and will likely be used at other places that need to build composite resources or use an API to generate resources rather than using the language for specifying all of them.