heat.engine.resources.template_resource module

class heat.engine.resources.template_resource.TemplateResource(name, definition, stack)[source]

Bases: heat.engine.resources.stack_resource.StackResource

A resource implemented by a nested stack.

This implementation passes resource properties as parameters to the nested stack. Outputs of the nested stack are exposed as attributes of this resource.


Override method of child_params for the resource.


parameter values for our nested stack based on our properties


Default implementation to get the child template.

Resources that inherit from StackResource should override this method with specific details about the template used by them.

get_attribute(key, *path)[source]

Default implementation for function get_attr and Fn::GetAtt.

This may be overridden by resource plugins to add extra logic specific to the resource implementation.


Default implementation for function get_resource.

This may be overridden by resource plugins to add extra logic specific to the resource implementation.

static get_schemas(tmpl, param_defaults)[source]
static get_template_file(template_name, allowed_schemes)[source]
handle_update(json_snippet, tmpl_diff, prop_diff)[source]

Refresh the metadata if new_metadata is None.


Default implementation; should be overridden by resources.

Should be overridden by resources that would require schema refresh during update, ex. TemplateResource.


Resource Definition

property template_url

Template url for the stack resource.

When stack resource is a TemplateResource, it’s the template location. For group resources like ResourceGroup where the template is constructed dynamically, it’s just a placeholder.


Validate the resource.

This may be overridden by resource plugins to add extra validation logic specific to the resource implementation.


Validate structural/syntax aspects of the resource definition.

Resource plugins should not override this, because this interface is expected to be called pre-create so things normally valid in an overridden validate() such as accessing properties may not work.

heat.engine.resources.template_resource.generate_class_from_template(name, data, param_defaults)[source]