'Create a template to represent autoscaled instances.
Also see heat.scaling.template.member_definitions.'

def _create_template(self, num_instances, num_replace=0, template_version=('HeatTemplateFormatVersion', '2012-12-12')):

    instance_definition = self._get_resource_definition()
    old_resources = grouputils.get_member_definitions(self, include_failed=True)
    definitions = list(template.member_definitions(old_resources, instance_definition, num_instances, num_replace, short_id.generate_id))
    child_env = environment.get_child_environment(self.stack.env, self.child_params(), item_to_remove=self.resource_info)
    tmpl = template.make_template(definitions, version=template_version, child_env=child_env)
    att_func = 'get_attr'
    if (att_func not in tmpl.functions):
        att_func = 'Fn::GetAtt'
    get_attr = functools.partial(tmpl.functions[att_func], None, att_func)
    for odefn in self._nested_output_defns([k for (k, d) in definitions], get_attr):
        tmpl.add_output(odefn)
    return tmpl
