Allow a resource to be added to a template

Add a method that allows a ResourceDefinition to be inserted into an
existing template.

Change-Id: Ia418127d72d26a77d731f93cc0eb3a45d983cc82
Merge "Allow a resource to be added to a template"